我使用Visual Studio的模型设计器来生成我的对象类。现在我想通过继承和 getter/setter 更改来调整生成的类。
例如,如果模型设计器创建了类浏览器:
public partial class Browser
{
public Browser(){}
public int Id { get; set; }
public string Name { get; set; }
}
我想将生成的代码调整为
public partial class Browser : ValidatableModel, IFormattable
{
public string name;
public Browser(){ name = "" }
public Guid Id { get; private set; }
public string Name
{
get { return name; }
set { SetPropertyAndValidate(ref name, value); }
}
}
我正在使用 WPF 应用程序框架,它以另一种方式实现数据库,而不是我想要的。
您知道在 WPF 中使用 Model First 方法的这种方法或任何其他方法的解决方案吗?我认为必须有一个。