public async Task Test_UpdateMGA()
        {
            var guid = await SeedMGAData();

            var advisor = new AdvisorDTO()
            {
                AdvisorId = guid.ToString(), Address = "Toronto", FirstName = "Advisor X2", LastName = "X2", PhoneNumber = "444-444-4444"
            };
            int ret = await _manager.Update(_mapper.Map <AdvisorEntity>(advisor), guid);

            Assert.AreEqual(1, ret);
            var newrec = await _manager.GetById(guid.ToString());

            Assert.AreEqual(advisor.AdvisorId, newrec.AdvisorId.ToString());
            Assert.AreEqual(advisor.FirstName, newrec.FirstName);
            Assert.AreEqual(advisor.LastName, newrec.LastName);
        }
        public async Task Test_UpdateMGA()
        {
            var guid = await SeedMGAData();

            var mga = new MGADTO()
            {
                BusinessId = guid.ToString(), BusinessAddress = "Toronto", BusinessName = "MGA X2", BusinessPhoneNumber = "555-555-5555"
            };
            // _manager = new MGAManager(DbContext(), MapperProfile());
            int ret = await _manager.Update(_mapper.Map <MGAEntity>(mga), guid);

            Assert.AreEqual(1, ret);
            var newmga = await _manager.GetById(guid.ToString());

            Assert.AreEqual(mga.BusinessId, newmga.BusinessId.ToString());
            Assert.AreEqual(mga.BusinessName, newmga.BusinessName);
            Assert.AreEqual(mga.BusinessPhoneNumber, newmga.BusinessPhoneNumber);
        }
 public async Task <int> Update([FromRoute] string id, [FromBody] CarrierDTO carrier)
 {
     return(await _carrierManager.Update(_mapper.Map <CarrierEntity>(carrier), id));
 }
 public async Task <int> Update([FromRoute] string id, [FromBody] ContractDTO contract)
 {
     return(await _contractsManager.Update(_mapper.Map <ContractEntity>(contract), id));
 }
Beispiel #5
0
 public async Task <int> Update([FromRoute] string id, [FromBody] AdvisorDTO advisor)
 {
     return(await _advisorManager.Update(_mapper.Map <AdvisorEntity>(advisor), id));
 }
 public async Task <int> Update([FromRoute] string id, [FromBody] MGADTO mga)
 {
     return(await _mgamanager.Update(_mapper.Map <MGAEntity>(mga), id));
 }