Exemple #1
0
        public JsonResult Items()
        {
            var data = _targetService.GetListForHomePage();
            List <TargetForHomePage> resultData = new List <TargetForHomePage>();

            foreach (var item in data)
            {
                var model = new TargetForHomePage
                {
                    id         = item.Id,
                    name       = item.Name,
                    statusCode = item.Status.LastOrDefault()?.Code,
                    url        = item.Url
                };
                resultData.Add(model);
            }
            return(new JsonResult(resultData));
        }