public async Task <IActionResult> Get(Guid id) { var remark = await _remarkService.GetAsync(id); var activities = await _remarkService.GetActivitiesAsync(id); var activityTypes = await _activityService.GetAsync(); var comments = await _remarkService.GetCommentsAsync(id); var images = await _remarkService.GetImagessAsync(id); var category = await _categorySevice.GetAsync(remark.CategoryId); var dto = new RemarkDto { Id = remark.Id, Name = remark.Name, Description = remark.Description, Latitude = remark.Latitude, Longitude = remark.Longitude, Author = remark.AuthorId, CategoryId = remark.CategoryId, CategoryName = category.Name, Status = remark.Status.ToString(), Activities = activities? .Select(x => new ActivityDto { Id = x.Id, Name = activityTypes.FirstOrDefault(y => y.Id == x.TypeId)?.Name }) .ToList(), Comments = comments .Select(x => new CommentDto { Id = x.Id, AuthorId = x.AuthorId, Status = x.Status.ToString(), Text = x.Text }) .ToList(), Images = images .Select(x => new ImageDto { Id = x.Id, Name = x.Name, Url = x.Url, }) .ToList() }; return(Ok(dto)); }