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); }
public async Task <IActionResult> Update([FromBody] OfficeModel data) { var dataUpdate = await _officeService.Update(OfficeMapper.Map(data)); return(Ok()); }
public async Task <IActionResult> Add([FromBody] OfficeModel data) { var dataEntity = await _officeService.Add(OfficeMapper.Map(data)); return(Ok(dataEntity)); }
public async Task <Office> UpdateOffice(Office office) { var updated = await _officeRepository.Update(OfficeMapper.Map(office)); return(OfficeMapper.Map(updated)); }
public async Task <Office> AddOffice(Office office) { var addedEntity = await _officeRepository.Add(OfficeMapper.Map(office)); return(OfficeMapper.Map(addedEntity)); }
public async Task <Office> GetOffice(int id) { var entidad = await _officeRepository.Get(id); return(OfficeMapper.Map(entidad)); }
public async Task <IActionResult> UpdateAdmin([FromBody] OfficeModel office) { var name = await _officeService.UpdateOffice(OfficeMapper.Map(office)); return(Ok(name)); }
public async Task <IActionResult> UpdateOffice([FromBody] OfficeModel Office) { var updatedOffice = await _officeService.UpdateOffice(OfficeMapper.Map(Office)); return(Ok(updatedOffice)); }
public async Task <IActionResult> AddOffice([FromBody] OfficeModel Office) { var newOffice = await _officeService.AddOffice(OfficeMapper.Map(Office)); return(Ok(newOffice)); }
public async Task <Office> Update(Office office) { var data = await _officeRepository.Update(OfficeMapper.Map(office)); return(office); }
public async Task <Office> Get(int id) { var office = await _officeRepository.Get(id); return(OfficeMapper.Map(office)); }