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>()); }
public static int Delete(this SqlDatabase db, object item, string id1 = null, string id2 = null) { return(db.ExecuteNonQuery(item.ToSqlDelete(id1, id2), item.ToSqlParameter())); }
public static T GetOne <T>(this SqlDatabase db, string cmdText, List <SqlParameter> param = null) where T : new() { return(GetList <T>(db, cmdText, param).FirstOrDefault()); }
public static int Insert(this SqlDatabase db, object item, string pk = null) { return(db.ExecuteNonQuery(item.ToSqlInsert(pk), item.ToSqlParameter())); }