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