Пример #1
0
 public async Task Post <T>(T entity)
 {
     await Task.Run(() =>
     {
         using var db = new LiteDB.LiteRepository(_connectionString);
         db.Insert(entity);
     });
 }
Пример #2
0
 public void Create(Customer customer)
 {
     using (var repo = new LiteDB.LiteRepository(ConnectionString))
     {
         try
         {
             repo.Insert(customer);
         }
         catch (DbException e)
         {
             throw e;
         }
     }
 }