如何在EF6中为自动生成的代码添加自定义静态方法? (使用model.tt)
public partial class tbl_Persons
{
public static void MyMethod(int personID)
{
//my codes
}
public tbl_Persons()
{
}
public int ID { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string FatherName { get; set; }
}
答案 0 :(得分:0)
将您的代码放在此文件中:
public partial class tbl_Persons
{
public static void MyMethod(int personID)
{
//my codes
}
}