Beispiel #1
0
 /// <summary>
 /// 更新实体
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="t"></param>
 /// <param name="AutoId">主键名称</param>
 /// <returns></returns>
 public static T UpdateM <T>(this T t, string AutoId = "id") where T : class
 {
     return(EntityOperate <T> .UpdateEntity(t, AutoId));
 }
Beispiel #2
0
 /// <summary>
 /// 删除实体
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="t"></param>
 /// <param name="strPrimaryKeyValue">主键值</param>
 /// <param name="strPrimaryKeyName">主键名</param>
 public static void DeleteM <T>(this T t, string strPrimaryKeyValue, string strPrimaryKeyName = "id") where T : class
 {
     EntityOperate <T> .DeleteById(strPrimaryKeyValue, strPrimaryKeyName);
 }
Beispiel #3
0
 /// <summary>
 /// 保存实体
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="t"></param>
 /// <param name="AutoId">自增ID字段</param>
 /// <returns></returns>
 public static int SaveModelM <T>(this T t, string AutoId = "id") where T : class
 {
     return(EntityOperate <T> .AddEntity(t, AutoId));
 }