public IActionResult Index() { var list = new List <ToDoCardViewModel>(); var id = ((ClaimsIdentity)User.Identity).GetSpecificClaim(ClaimTypes.NameIdentifier); var titleList = _toDoTitleService.GetList(c => c.UserId == Guid.Parse(id)).Data; var itemList = _toDoItemService.GetList().Data; foreach (var title in titleList) { var items = itemList.Where(c => c.ToDoTitleId == title.Id).ToList(); list.Add(new ToDoCardViewModel() { ToDoItem = items, ToDoTitle = title }); } return(Ok(list)); }