예제 #1
0
 public async Task <int> UpdateAsync(TightenModel model)
 {
     if (FreeHanlder.SqliteHandler == null)
     {
         throw new NullReferenceException("未初始化SqliteHandler数据库访问程序;");
     }
     return(await FreeHanlder.SqliteHandler.Update <TightenModel>()
            .SetSource(model)
            .ExecuteAffrowsAsync());
 }
예제 #2
0
 /// <summary>
 /// 保存拧紧数据
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int Insert(TightenModel model)
 {
     try
     {
         if (FreeHanlder.SqliteHandler == null)
         {
             throw new NullReferenceException("未初始化SqliteHandler数据库访问程序;");
         }
         model.Id = (int)FreeHanlder.SqliteHandler.Insert <TightenModel>()
                    .AppendData(model)
                    .ExecuteIdentity();
         return(model.Id);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }