Esempio n. 1
0
 public async Task <int> Insert(EngineInfoModel model)
 {
     try
     {
         if (FreeHanlder.SqliteHandler == null)
         {
             throw new NullReferenceException("未初始化SqliteHandler数据库访问程序;");
         }
         model.Id = (int)(await FreeHanlder.SqliteHandler.Insert <EngineInfoModel>()
                          .AppendData(model)
                          .ExecuteIdentityAsync());
         return(model.Id);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 2
0
 public async Task <int> Update(EngineInfoModel model)
 {
     if (model == null)
     {
         throw new ArgumentNullException(nameof(model));
     }
     try
     {
         if (FreeHanlder.SqliteHandler == null)
         {
             throw new NullReferenceException("未初始化SqliteHandler数据库访问程序;");
         }
         return(await FreeHanlder.SqliteHandler.Update <EngineInfoModel>()
                .SetSource(model)
                .ExecuteAffrowsAsync());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }