public async Task <IActionResult> AgencyGetByIdAsync(int id) { var req = new AgencyGetByIdRequest { Id = id }; var result = await _AgencyManager.GetAgencyByIdAsync(req); return(Ok(result)); }
public async Task <AgencyGetByIdResponse> GetAgencyByIdAsync(AgencyGetByIdRequest req) { using (var conn = new SqlConnection(_connectionSettings.DefaultConnection)) { var result = new AgencyGetByIdResponse(); const string storeproc = @"[dbo].[uspAgenciesGetById_New]"; await conn.OpenAsync(); var dynParm = new { ID = req.Id }; var rawResult = await conn.QueryAsync <AgencyDTO>(storeproc, dynParm, null, null, CommandType.StoredProcedure); result.Data = rawResult.FirstOrDefault(); return(result); } }
public async Task <AgencyGetByIdResponse> GetAgencyByIdAsync(AgencyGetByIdRequest req) { var result = await _repos.GetAgencyByIdAsync(req); return(result); }