public void DeleteContractorProfile(string emailAddress) { ContractorProfile profileToDelete = FindContractorProfile(emailAddress); DbContext.ContractorProfiles.Remove(profileToDelete); DbContext.SaveChanges(); }
public void TestSaveContractorProfile() { Repository.SaveNewContractorProfile(ContractorProfile); ContractorProfile savedContractorProfile = Repository.FindContractorProfile(ContractorAccountEmail); Assert.NotNull(savedContractorProfile); }
public void SetUpContractorProfile() { ContractorProfile = new ContractorProfile { EmailAddress = ContractorAccountEmail, FirstName = "Jason", LastName = "Bourne" }; }
private void CreateContractorProfile(ContractorAccount contractorAccount) { ContractorProfile ContractorProfile = new ContractorProfile { EmailAddress = contractorAccount.EmailAddress, FirstName = contractorAccount.FirstName, LastName = contractorAccount.LastName }; ContractorProfileRepository.SaveNewContractorProfile(ContractorProfile); }
// GET: Contractors/Details/5 public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } ContractorProfile profile = new ContractorProfile(_context, id); var contractor = await _context.Contractor.Include(u => u.User).Include(c => c.Services).SingleOrDefaultAsync(c => c.ContractorId == id); profile.Contractor = contractor; if (contractor == null) { return(NotFound()); } return(View(profile)); }
public void MarkAsModified(ContractorProfile contractorProfile) { DbContext.Entry(contractorProfile).State = EntityState.Modified; }
public ContractorProfile FindContractorProfile(string emailAddress) { ContractorProfile contractorProfile = DbContext.ContractorProfiles.Find(emailAddress); return(contractorProfile); }
public void SaveNewContractorProfile(ContractorProfile contractorProfile) { DbContext.ContractorProfiles.Add(contractorProfile); DbContext.SaveChanges(); }