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