小编nil*_*oru的帖子

如何覆盖分部类中的属性?

我正在开发一个MVC应用程序,我在开发它时使用了EF 4.0.我已经从模型中创建了类.现在,我想为MVC创建的每个类添加更多类.

恩.在下面的代码中,我得到了类Location.现在,我想再创建一个类(Partial class)如何覆盖分部类中的属性?

怎么做 ?

namespace Entities
{
   public partial class Location
   {               
       public int Id { get; set; }

       public string Name { get; set; }
       public string Remark { get; set; }      
       public string State { get; set; }       
       public string Region { get; set; }
       public string PinCode { get; set; }

       public virtual ICollection<Comment> Comments { get; set; }
   }    
}
Run Code Online (Sandbox Code Playgroud)

model-view-controller asp.net-mvc entity entity-framework-4

0
推荐指数
1
解决办法
5116
查看次数