public async Task RemoveOk() { var contactType = ContactTypeFaker.GetContactTypeOk(); await _db.ContactTypes.AddAsync(contactType); await _db.SaveChangesAsync(); _contactTypeRepository.Remove(contactType.Id); await _contactTypeRepository.CommitAsync(); var result = await _contactTypeRepository.GetByIdAsync(contactType.Id); Assert.Null(result); }
public async Task <CommitResponse> CommitAsync() { try { var rowsAffected = await Context.SaveChangesAsync(); return(rowsAffected > 0 ? CommitResponse.Ok(rowsAffected) : CommitResponse.Fail()); } catch (Exception ex) { return(CommitResponse.Fail(ex.Message)); } }