public HttpResponseMessage Get() { var users = _usersDomain.GetAll(); var usersDto = _mapper.Map <IEnumerable <Entity.User>, IEnumerable <UserDto> >(users); IContentNegotiator negotiator = Configuration.Services.GetContentNegotiator(); ContentNegotiationResult result = negotiator.Negotiate( usersDto.GetType(), Request, Configuration.Formatters); if (result == null) { var response = new HttpResponseMessage(HttpStatusCode.NotAcceptable); throw new HttpResponseException(response); } return(new HttpResponseMessage() { Content = new ObjectContent <IEnumerable <UserDto> >( usersDto, result.Formatter, result.MediaType.MediaType ) }); }
public IActionResult Index() { return(View(_usersDomain.GetAll())); }
public IEnumerable <UserDto> Get() { return(_usersDomain.GetAll()); }