public RetrieveResult <WildfireAssessmentMitigationRecommendationsViewModel> RetrieveView(DataSourceRequest request, Guid mitigationRecommendationId) { var dbSet = context.Set <InspectionOrderWildfireAssessmentMitigationRecommendations>() .Include(a => a.Image) .Where(a => a.InspectionOrderWildfireAssessmentMitigation.Id == mitigationRecommendationId) .OrderBy(a => a.Image.CreatedAt); var resultList = Retrieve(dbSet, request); var mitigationList = new RetrieveResult <WildfireAssessmentMitigationRecommendationsViewModel>(); mitigationList.PageNo = resultList.PageNo; mitigationList.SortBy = resultList.SortBy; mitigationList.RecordPage = resultList.RecordPage; mitigationList.TotalRecords = resultList.TotalRecords; mitigationList.Results = resultList.Results.Select(mitigation => new WildfireAssessmentMitigationRecommendationsViewModel { InspectionOrderWildfireAssessmentMitigationId = mitigation.InspectionOrderWildfireAssessmentMitigationId, InspectionOrderWildfireAssessmentMitigation = mitigation.InspectionOrderWildfireAssessmentMitigation, Id = mitigation.Id, Description = mitigation.Description, ImageId = mitigation.ImageId, Image = mitigation.Image, ChildMitigation = mitigation.ChildMitigation, ChildMitigationCount = _inspectionOrderWildfireAssessmentChildMitigationRecommendationsRepository.childMitigationCount(mitigation.Id), Status = mitigation.Status }).ToList(); return(mitigationList); }
//[Authorize(Policy = PolicyNames.Anyone)] public IActionResult RetrieveWildfireAssessmentChildMitigationRecommendationsCount(Guid parentMitigationId) { return(Ok(_inspectionOrderWildfireAssessmentChildMitigationRecommendationsRepository.childMitigationCount(parentMitigationId))); }