How can I add a custom static method to auto generated codes in EF6? (using 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; }
}
Place your code in this file:
public partial class tbl_Persons { public static void MyMethod(int personID) { //my codes } }
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.