Esempio n. 1
0
        public List <OfficeDTO> GetAllOfficeAddress()
        {
            IList <Office>   offices    = _uoW.OfficeRepository.GetAll();
            List <OfficeDTO> dtoResults = _officeMapper.Map(offices);
            var addressService          = new AddressService(_domainEventPublisher, _uoW);

            dtoResults.Select(o => o.Address = _officeMapper.Map(addressService.GetOfficeFullAddress(o.Id))).ToList();

            return(dtoResults);
        }
Esempio n. 2
0
        public async Task <IActionResult> Update([FromBody] OfficeModel data)
        {
            var dataUpdate = await _officeService.Update(OfficeMapper.Map(data));

            return(Ok());
        }
Esempio n. 3
0
        public async Task <IActionResult> Add([FromBody] OfficeModel data)
        {
            var dataEntity = await _officeService.Add(OfficeMapper.Map(data));

            return(Ok(dataEntity));
        }
Esempio n. 4
0
        public async Task <Office> UpdateOffice(Office office)
        {
            var updated = await _officeRepository.Update(OfficeMapper.Map(office));

            return(OfficeMapper.Map(updated));
        }
Esempio n. 5
0
        public async Task <Office> AddOffice(Office office)
        {
            var addedEntity = await _officeRepository.Add(OfficeMapper.Map(office));

            return(OfficeMapper.Map(addedEntity));
        }
Esempio n. 6
0
        public async Task <Office> GetOffice(int id)
        {
            var entidad = await _officeRepository.Get(id);

            return(OfficeMapper.Map(entidad));
        }
Esempio n. 7
0
        public async Task <IActionResult> UpdateAdmin([FromBody] OfficeModel office)
        {
            var name = await _officeService.UpdateOffice(OfficeMapper.Map(office));

            return(Ok(name));
        }
Esempio n. 8
0
        public async Task <IActionResult> UpdateOffice([FromBody] OfficeModel Office)
        {
            var updatedOffice = await _officeService.UpdateOffice(OfficeMapper.Map(Office));

            return(Ok(updatedOffice));
        }
Esempio n. 9
0
        public async Task <IActionResult> AddOffice([FromBody] OfficeModel Office)
        {
            var newOffice = await _officeService.AddOffice(OfficeMapper.Map(Office));

            return(Ok(newOffice));
        }
Esempio n. 10
0
        public async Task <Office> Update(Office office)
        {
            var data = await _officeRepository.Update(OfficeMapper.Map(office));

            return(office);
        }
Esempio n. 11
0
        public async Task <Office> Get(int id)
        {
            var office = await _officeRepository.Get(id);

            return(OfficeMapper.Map(office));
        }