public void SaveNewContract(Contract newContract) { DbContext.Contracts.Add(newContract); DbContext.SaveChanges(); OrganisationRepository HelperRepository = new OrganisationRepository(DbContext); HelperRepository.IncreaseNumberOfContracts(newContract.OrganisationId); }
public void DeleteContract(int contractId) { Contract contract = FindContractById(contractId); DbContext.Contracts.Remove(contract); DbContext.SaveChanges(); OrganisationRepository HelperRepository = new OrganisationRepository(DbContext); HelperRepository.DecreaseNumberOfContracts(contract.OrganisationId); }