public static List <T> GetAll <T>(this IDBComplete <T> db, DatabaseLogger Logger = null) where T : new() { var control = db.GetBControl(); return(control.GetAll(Logger: Logger)); }
public static bool Delete <T>(this IDBComplete <T> db, DatabaseLogger Logger = null) where T : new() { var control = db.GetBControl(); return(control.Delete(Condition: control.PrimaryKey, Logger: Logger) == 1); }
public static bool Update <T>(this IDBComplete <T> db, DatabaseLogger Logger = null) where T : new() { var control = db.GetBControl(); return(control.Update(!control.PrimaryKey, control.PrimaryKey, Logger) == 1); }
public static bool Get <T>(this IDBComplete <T> db) where T : new() { var control = db.GetBControl(); return(control.Get(Condition: control.PrimaryKey)); }
public static int Add <T>(this IDBComplete <T> db, DatabaseLogger Logger = null) where T : new() { var control = db.GetBControl(); if (control.PrimaryKey == null) { throw new NullReferenceException("No primary key found"); } int ID = control.Insert(!control.PrimaryKey, Logger); // assign id control.PrimaryKey.AssignRawValue(ID); return(ID); }