public ServiceSingleResult <bool> AddReport(Report report) { var result = new ServiceSingleResult <bool>(); if (report != null && report.Issue != null) { var projUserRef = _accessService.GetAccessByReport(report, report.ReporterId); if (projUserRef == null || !Inspector.CanUserAddReport(projUserRef)) { result.HandleError(ErrorMessagesDict.AccessDenied); return(result); } _context.Reports.Add(report); try { _context.SaveChanges(); result.TargetObject = true; } catch (Exception exc) { result.HandleError(exc.Message); } return(result); } result.HandleError(ErrorMessagesDict.NullInstance); return(result); }