Exemple #1
0
        public async Task <IHttpActionResult> GetAll()
        {
            var officeassignments = await officeassignmentService.GetAll();

            var officeassignmentsDTO = officeassignments.Select(x => mapper.Map <OfficeAssignmentDTO>(x));

            return(Ok(officeassignmentsDTO));
        }
        public async Task <IHttpActionResult> Get()
        {
            var officeAssignment = await officeAssignmentService.GetAll();

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

            return(Ok(officeAssignmentDTO)); // Status code 200
        }
Exemple #3
0
        public async Task <IHttpActionResult> GetAll()//se devuelve un DTO
        {
            var officeAssignments = await officeAssignmentService.GetAll();

            //AutoMapper
            var officeAssignmentsDTO = officeAssignments.Select(x => _mapper.Map <OfficeAssignmentResponseDTO>(x));

            return(Ok(officeAssignmentsDTO));
        }
Exemple #4
0
        // GET: OfficeAssignments
        public async Task <ActionResult> Index()
        {
            var officeAssignmentService = new OfficeAssignmentService(new OfficeAssignmentRepository(UniversityContext));

            var officeAssignments = await officeAssignmentService.GetAll();

            var officeAssignmentsDTO = officeAssignments.Select(x => mapper.Map <OfficeAssignmentDTO>(x));

            return(View(officeAssignmentsDTO));
        }