public ActionResult <List <AccelerationDTO> > GetAll(int?companyId = null)
        {
            if (companyId == null)
            {
                return(NoContent());
            }

            return(Ok(_mapper.Map <List <AccelerationDTO> >(_accelerationService.FindByCompanyId(companyId.GetValueOrDefault()))));
        }
Exemplo n.º 2
0
        public ActionResult <IEnumerable <AccelerationDTO> > GetAll(int?companyId = null)
        {
            if (companyId == null)
            {
                return(NoContent());
            }

            return(Ok(_mapper.Map <IEnumerable <AccelerationDTO> >(_service.FindByCompanyId((int)companyId))));
        }
Exemplo n.º 3
0
 public ActionResult <IEnumerable <AccelerationDTO> > GetAll([FromQuery] int?companyId = null)
 {
     if (companyId.HasValue)
     {
         return(Ok(_mapper.Map <List <AccelerationDTO> >(_service.FindByCompanyId(companyId.Value))));
     }
     else
     {
         return(NoContent());
     }
 }
Exemplo n.º 4
0
        public ActionResult <IEnumerable <AccelerationDTO> > GetAll(int?companyId = null)
        {
            if (companyId == null)
            {
                return(NoContent());
            }

            var result = _accelerationService.FindByCompanyId(companyId.Value);

            return(Ok(_mapper.Map <IEnumerable <AccelerationDTO> >(result).ToList()));
        }
        public ActionResult <IEnumerable <AccelerationDTO> > GetAll(int?companyId = null)
        {
            if (companyId == null)
            {
                return(NoContent());
            }

            ICollection <Acceleration> accelerations = _accelerationService.FindByCompanyId(companyId.GetValueOrDefault());

            return(Ok(_mapper.Map <List <AccelerationDTO> >(accelerations)));
        }
Exemplo n.º 6
0
        public ActionResult <IEnumerable <AccelerationDTO> > GetAll(int?companyId = null)
        {
            if (!companyId.HasValue)
            {
                return(Ok(null));
            }

            var accelerations = _service.FindByCompanyId(companyId.Value);

            return(Ok(_mapper.Map <IList <AccelerationDTO> >(accelerations)));
        }
Exemplo n.º 7
0
 public ActionResult <List <AccelerationDTO> > GetAll(int?companyId)
 {
     if (companyId != null)
     {
         List <AccelerationDTO> accelerationDtoList = _accelerationService.FindByCompanyId(companyId.Value).Select(x => _mapper.Map <AccelerationDTO>(x)).ToList();
         return(Ok(accelerationDtoList));
     }
     else
     {
         return(NoContent());
     }
 }
        public ActionResult<IEnumerable<AccelerationDTO>> GetAll(int? companyId = null)

        {

            if (companyId != null)

                return Ok(_mapper.Map<IEnumerable<AccelerationDTO>>(_service.FindByCompanyId(companyId.Value)));


            return NoContent();

        }
        public ActionResult <IEnumerable <AccelerationDTO> > GetAll(int?companyId = null)
        {
            if (companyId == null)
            {
                return(StatusCode(204));
            }

            List <Acceleration> list;

            list = _service.FindByCompanyId((int)companyId).ToList();

            return(Ok(_serviceConvertToListDTO.Execute(list)));
        }
Exemplo n.º 10
0
 public ActionResult <IEnumerable <AccelerationDTO> > GetAll(int?companyId = null)
 {
     if (companyId.HasValue)
     {
         return(Ok(_accelerationService.FindByCompanyId(companyId.Value)
                   .Select(x => _mapper.Map <AccelerationDTO>(x))
                   .ToList()));
     }
     else
     {
         return(NoContent());
     }
 }
Exemplo n.º 11
0
        public ActionResult <IEnumerable <AccelerationDTO> > GetAll(int?companyId = null)
        {
            if (companyId == default)
            {
                return(NoContent());
            }

            var accelerations = service.FindByCompanyId(companyId.Value).
                                Select(x => mapper.Map <AccelerationDTO>(x)).
                                ToList();

            return(Ok(accelerations));
        }
Exemplo n.º 12
0
        public ActionResult <IEnumerable <AccelerationDTO> > GetAll(int?companyId = null)
        {
            if (!companyId.HasValue)
            {
                return(NoContent());
            }

            IEnumerable <AccelerationDTO> accelerations = _service.FindByCompanyId(companyId.Value)
                                                          .Select(acceleration => _mapper.Map <AccelerationDTO>(acceleration))
                                                          .ToList();

            return(Ok(accelerations));
        }
 public ActionResult <IEnumerable <AccelerationDTO> > GetAll(int?companyId = null)
 {
     if (companyId != null)
     {
         var accelid    = _service.FindByCompanyId(companyId.GetValueOrDefault());
         var accelidDTO = _mapper.Map <List <AccelerationDTO> >(accelid);
         return(Ok(accelidDTO));
     }
     else
     {
         return(NoContent());
     }
 }
Exemplo n.º 14
0
        public ActionResult <IEnumerable <AccelerationDTO> > GetAll(int?companyId = null)
        {
            if (companyId.HasValue)
            {
                var acceleration = _accelerationService.FindByCompanyId(companyId.Value).ToList();
                var retorno      = _mapper.Map <List <AccelerationDTO> >(acceleration);

                return(Ok(retorno));
            }
            else
            {
                return(NoContent());
            }
        }
        public ActionResult <IEnumerable <AccelerationDTO> > GetAll(int?companyId = null)
        {
            if (companyId == null)
            {
                return(NoContent());
            }
            else
            {
                var companyIdNt   = companyId.GetValueOrDefault();
                var accelerations = _accelerationService.FindByCompanyId(companyIdNt).AsQueryable();
                return(Ok(_mapper.Map <List <AccelerationDTO> >(accelerations).ToList()));
            }

            throw new Exception();
        }
        public ActionResult <IEnumerable <AccelerationDTO> > GetAll(int?companyId = null)
        {
            if (companyId == null)
            {
                return(NoContent());
            }

            var _accelerations = _accelerationService.FindByCompanyId(companyId ?? 0).ToList();

            if (_accelerations == null)
            {
                return(NoContent());
            }
            else
            {
                var retorno = _mapper.Map <List <AccelerationDTO> >(_accelerations);
                return(Ok(retorno));
            }
        }
        public ActionResult <IEnumerable <AccelerationDTO> > GetAll(int?companyId = null)
        {
            try
            {
                IList <Acceleration> acceleration = new List <Acceleration>();

                if (companyId == null)
                {
                    return(NoContent());
                }

                acceleration = _service.FindByCompanyId((int)companyId);

                var result = _mapper.Map <List <AccelerationDTO> >(acceleration);
                return(Ok(result));
            }
            catch (Exception)
            {
                throw;
            }
        }
 public ActionResult <IEnumerable <AccelerationDTO> > GetAll(int?companyId = null)
 {
     return(Ok(_mapper.Map <List <AccelerationDTO> >(_accelerationService.FindByCompanyId(companyId.Value))));
 }