这是我生成的类Customer
namespace Winpro
{
using System;
using System.Collections.Generic;
public partial class Customer
{
public Customer()
{
this.Blocked = false;
this.Code = "#00000";
this.Contacts = new ObservableListSource<Contact>();
}
public int Id { get; set; }
public string Name { get; set; }
public string Code { get; set; }
...
ValidateCustomer类
namespace Winpro
{
public partial class Customer
{
partial void OnCodeChanging(string value)
{
if (string.IsNullOrEmpty(value))
throw new InvalidOperationException("value cannot be null or empty");
}
}
}
解决方案有两个项目:
+ Database (model and validation) <-- here I'm creating ValidateCustomer class
+ Winpro (winApp)
Error 1 No defining declaration found for implementing declaration of partial method 'Winpro.Customer.OnCodeChanging(string)' C:\Users\..\Projects\Winpro\Database\ValidateCustomer.cs 12 22 Database
我已经读过这是名称空间问题,但是从发布的代码中可以看出所有类都在同一名称空间中?
我该怎么做才能纠正这个错误。
我之前的问题,我从哪里获得此代码和解释: