三层结构的Model中关于自定义类型的作用?
比如model层中有两个类 news和category,
Category类中:
public int Id{get;set;}
public string Name{get;set;}
public int Id{get;set;}
public int Cid{get;set;}
public string Title{get;set;}
public Category Category{get;set;} //注意这个
Model.Admin model = new Model.Admin();//对象
model.AddTime = DateTime.Now;//DateTime
model.Email = "abc@email.com";//string nvarchar
model.IsPass = true; //bool bit
model.Lastloginip = "192.168.1.1";//string nvarhar
model.Logincount = 1; //int
new BLL.Admin().Add(model);//添加
new BLL.Admin().Update(model, "ID=1");//修改