public static void InitDB()
 {
     if (Session_DB.GetAll <PersonModel>() == null)
     {
         Session_DB.Submit <PersonModel>(PersonModel.TestPersons);
     }
 }
Example #2
0
 public static T Read <T>(int id) where T : Model
 {
     return(Session_DB.Read <T>(id));
 }
Example #3
0
 public static List <T> GetAll <T>() where T : Model
 {
     return(Session_DB.GetAll <T>());
 }
Example #4
0
 public T Insert <T>() where T : Model
 {
     this.Id = Model.PK;
     return(Session_DB.Create <T>((T)this));
 }
Example #5
0
 public T Update <T>() where T : Model
 {
     return(Session_DB.Update <T>((T)this));
 }
Example #6
0
 public T Destroy <T>() where T : Model
 {
     return(Session_DB.Destroy <T>(this.Id));
 }