Exemplo n.º 1
0
        public IActionResult GetAll(GetResidencesFilter filter)
        {
            var users  = _residencesService.GetAll(filter);
            var result = users.Select(x => new ResidenceModel()
            {
                Id          = x.Id,
                Name        = x.Name,
                Description = x.Description,
                Address     = x.Address,
                ImageUrl    = x.ImageUrl,
                ThumbUrl    = x.ThumbnailUrl,
                IsAvailable = x.IsAvailable,
                CreatedAt   = x.CreatedAt.GetValueOrDefault(new DateTime(2019, 01, 01)),
                CreatedBy   = x.CreatedBy,
                UpdatedAt   = x.UpdatedAt,
                UpdatedBy   = x.UpdatedBy
            }).ToArray();

            return(Ok(result));
        }
Exemplo n.º 2
0
 public IEnumerable <ResidenceViewModel> Get()
 {
     return(_mapper.Map <IEnumerable <ResidenceDTO>, IEnumerable <ResidenceViewModel> >(_residencesService.GetAll()));;
 }