public async Task <DlmtCaseSummaryUpdateResponse> UpdateDlmtCaseSummaryAsync(DlmtCaseSummaryUpdateRequest req) { using (var conn = new SqlConnection(_connectionSettings.DefaultConnection)) { var result = new DlmtCaseSummaryUpdateResponse(); const string storeproc = @"[dbo].[uspCaseMainSave_New]"; await conn.OpenAsync(); var dynParm = new { req.CaseSummary.Id, req.CaseSummary.CaseNumber, req.CaseSummary.CaseTypeId, req.CaseSummary.AgencyId, req.CaseSummary.PlanningOfficeId, req.CaseSummary.ZoneAreaId, req.CaseSummary.UpdatedBy, req.CaseSummary.UpdatedDate }; var rawResult = await conn.QueryAsync <DlmtCaseSummaryDTO>(storeproc, dynParm, null, null, CommandType.StoredProcedure); result.Data = rawResult.FirstOrDefault(); return(result); } }
public async Task <DlmtCaseSummaryUpdateResponse> UpdateDlmtCaseSummaryAsync(DlmtCaseSummaryUpdateRequest req) { var result = new DlmtCaseSummaryUpdateResponse(); var validateResult = await ValidateDlmtCaseSummaryModel(req); if (validateResult != null && validateResult.Any()) { result.HasError = true; result.ErrorMsgs = validateResult; return(result); } req.CaseSummary.UpdatedDate = DateTime.Today; return(await _repos.UpdateDlmtCaseSummaryAsync(req)); }