Example #1
0
 public static List <T> GetList <T>(this SqlDatabase db, string cmdText, List <SqlParameter> param = null) where T : new()
 {
     return(db.GetDataTable(cmdText, param).To <T>());
 }
Example #2
0
 public static int Delete(this SqlDatabase db, object item, string id1 = null, string id2 = null)
 {
     return(db.ExecuteNonQuery(item.ToSqlDelete(id1, id2), item.ToSqlParameter()));
 }
Example #3
0
 public static T GetOne <T>(this SqlDatabase db, string cmdText, List <SqlParameter> param = null) where T : new()
 {
     return(GetList <T>(db, cmdText, param).FirstOrDefault());
 }
Example #4
0
 public static int Insert(this SqlDatabase db, object item, string pk = null)
 {
     return(db.ExecuteNonQuery(item.ToSqlInsert(pk), item.ToSqlParameter()));
 }