コード例 #1
0
        public async Task <IActionResult> GetPagedResults([FromBody] SearchObjectModel searchObjectModel)
        {
            if (!ModelState.IsValid)
            {
                return(ValidationProblem(ModelState));
            }

            (IEnumerable <WebSite> result, int count) = await _webSiteService.GetWebSites(_searchObjectMapper.ModelToEntity(searchObjectModel));

            var modelResults = result.Select(x => _webSiteMapper.EntityToModel(x)).ToArray();

            return(Ok(new PagedResult {
                WebSites = modelResults, TotalCount = count
            }));
        }
コード例 #2
0
        public IActionResult WebSiteList()
        {
            var model = _webSiteService.GetWebSites().ToList();

            return(View(model));
        }