Esempio n. 1
0
        public IHttpActionResult Get([FromUri] ClashSearchQueryModel queryModel)
        {
            if (!ModelState.IsValid)
            {
                return(this.Error().InvalidParameters("One or more of the required query parameters are missing."));
            }
            if (queryModel == null)
            {
                queryModel = new ClashSearchQueryModel();
            }
            var clashes = _clashRepository.Search(queryModel);

            var searchModel = new SearchResultModel <ClashNameModel>
            {
                Items      = clashes.Items.ToList(),
                TotalCount = clashes.TotalCount
            };

            return(Ok(searchModel));
        }