Пример #1
0
 public async Task Put <T>(T entity) where T : IEntity
 {
     await Task.Run(() =>
     {
         using var db = new LiteDB.LiteRepository(_connectionString);
         db.Update(entity);
     });
 }
Пример #2
0
 /// <summary>
 /// Updates customer information to database.
 /// </summary>
 /// <param name="customer"></param>
 /// <returns></returns>
 public bool Update(Customer customer)
 {
     using (var repo = new LiteDB.LiteRepository(ConnectionString))
     {
         try
         {
             return(repo.Update(customer));
         }
         catch (DbException e)
         {
             throw e;
         }
     }
 }