Пример #1
0
        public void DeleteContractorProfile(string emailAddress)
        {
            ContractorProfile profileToDelete = FindContractorProfile(emailAddress);

            DbContext.ContractorProfiles.Remove(profileToDelete);
            DbContext.SaveChanges();
        }
Пример #2
0
        public void TestSaveContractorProfile()
        {
            Repository.SaveNewContractorProfile(ContractorProfile);
            ContractorProfile savedContractorProfile = Repository.FindContractorProfile(ContractorAccountEmail);

            Assert.NotNull(savedContractorProfile);
        }
Пример #3
0
 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);
        }
Пример #5
0
        // 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));
        }
Пример #6
0
 public void MarkAsModified(ContractorProfile contractorProfile)
 {
     DbContext.Entry(contractorProfile).State = EntityState.Modified;
 }
Пример #7
0
        public ContractorProfile FindContractorProfile(string emailAddress)
        {
            ContractorProfile contractorProfile = DbContext.ContractorProfiles.Find(emailAddress);

            return(contractorProfile);
        }
Пример #8
0
 public void SaveNewContractorProfile(ContractorProfile contractorProfile)
 {
     DbContext.ContractorProfiles.Add(contractorProfile);
     DbContext.SaveChanges();
 }