Esempio n. 1
0
        [HttpHead] //Displays information that might be useful for the user.
        //[FromQuery] is necessary to be mentioned when passing arguments that will come from a query
        //String and other basic types are automatically understood by application but complex types
        //Like objects aren't and FromQuery should be mentioned necessarily otherwise program will assume that the
        //argument will be passed from the body.

        public ActionResult <IEnumerable <BandDTO> > GetAllBands(
            //[FromQuery]string Genre, [FromQuery]string Search
            [FromQuery] BandsResourceParameters bandsResourceParameters)
        {
            var bandsFromRepo = _bandAlbumRepository.GetAllBands(bandsResourceParameters);

            return(Ok(_mapper.Map <IEnumerable <BandDTO> >(bandsFromRepo)));
        }