Exemplo 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);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Update([FromBody] OfficeModel data)
        {
            var dataUpdate = await _officeService.Update(OfficeMapper.Map(data));

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

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

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

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

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

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

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

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

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

            return(OfficeMapper.Map(office));
        }