public async Task Delete <T>(Guid id) where T : IEntity { await Task.Run(() => { using var db = new LiteDB.LiteRepository(_connectionString); db.Delete <T>(e => e.Id == id); }); }
/// <summary> /// Deletes customer from database by id. /// </summary> /// <param name="id"></param> /// <returns></returns> public bool Delete(Guid id) { using (var repo = new LiteDB.LiteRepository(ConnectionString)) { try { return(repo.Delete <Customer>(id)); } catch (DbException e) { throw e; } } }