public static void Create(Type type, bool overwrite = false) { if (overwrite) { DBAccess.Connection.DropTable(DBAccess.GetMapping(type)); } DBAccess.Connection.CreateTable(type); }
public static List <object> GetAll(Type type) { var query = "SELECT * FROM " + type.Name; return(DBAccess.Connection.Query(DBAccess.GetMapping(type), query)); }
public static object Get(Type type, int id) { return(DBAccess.Connection.Get(id, DBAccess.GetMapping(type))); }
public static IEnumerable <string> GetColumnNames(Type type) { return(DBAccess.GetMapping(type).Columns.Select(c => c.Name)); }
public static IEnumerable <string> GetColumnNames <T>() where T : class, IEntity, new() { return(DBAccess.GetMapping <T>().Columns.Select(c => c.Name)); }