【发布时间】:2014-01-23 16:31:00
【问题描述】:
这是我自动生成的客户类的开始:
namespace Winpro
{
using System;
using System.Collections.Generic;
public partial class Customer
{
public Customer()
{
this.Blocked = false;
this.Code = "#00000";
this.RuleId = 1;
this.LocationId = 1;
this.Contacts = new ObservableListSource<Contact>();
}
public int Id { get; set; }
public string Name { get; set;
public System.DateTime Added { get; set; }
...
为什么我不能以这种方式扩展类。
namespace Winpro
{
public partial class Customer
{
public Customer()
{
this.Added = DateTime.Now;
}
寻找在单独的类中设置默认值或覆盖 SaveChanges() 方法的简单示例。
谢谢
【问题讨论】:
标签: c# .net entity-framework class entity