Ejemplo n.º 1
0
        public async Task <IActionResult> Get(long companyId, long cityId)
        {
            var locationFromRepo = await _location.GetById(companyId, cityId);

            if (locationFromRepo == null)
            {
                return(NotFound("We could not found this location"));
            }

            var locationToReturn = _mapper.Map <LocationToViewCompanyDTO>(locationFromRepo);

            return(Ok(locationToReturn));
        }
Ejemplo n.º 2
0
        public ActionResult <LocationDto> GetById([FromRoute] Guid id)
        {
            if (id != null)
            {
                var location = _locationLogic.GetById(id);

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

                return(Ok(location));
            }
            return(NotFound());
        }