public async Task <IHttpActionResult> Get(int id)
        {
            var officeAssignment = await officeAssignmentService.GetById(id);

            var officeAssignmentDTO = mapper.Map <OfficeAssignmentDTO>(officeAssignment);

            return(Ok(officeAssignmentDTO)); // Status code 200
        }
Exemple #2
0
        public async Task <IHttpActionResult> GetById(int id)
        {
            var officeassignment = await officeassignmentService.GetById(id);

            if (officeassignment == null)
            {
                return(NotFound());
            }

            var officeassignmentDTO = mapper.Map <OfficeAssignmentDTO>(officeassignment);

            return(Ok(officeassignmentDTO));
        }
Exemple #3
0
        public async Task <IHttpActionResult> GetById(int id)//se devuelve un DTO
        {
            var officeAssignment = await officeAssignmentService.GetById(id);

            if (officeAssignment == null)
            {
                return(NotFound());
            }

            var officeAssignmentDTO = _mapper.Map <OfficeAssignmentResponseDTO>(officeAssignment);

            return(Ok(officeAssignmentDTO));
        }