public async Task <T> GetData <T>(HttpClient client, TrackingParameter parameter) where T : new() { var url = _urlMapping.GetTrackingUrl <T>(); return(url.IsNullOrEmpty() ? default : await client.PostJsonAsync <T>(url, parameter)); }
private async Task <T> GetTracking <T>(TrackingParameter parameter) { var procAttr = SqlMapperEx.GetStoredProcedureAttribute <T>(); var sqlParameters = new DynamicParameters(); sqlParameters.Add(procAttr.KeyColumnName, parameter.Id); sqlParameters.Add("LanguageID", parameter.Language); using (var connection = new SqlConnection(ConnectionString)) { var result = await connection.QueryMultipleAsync(procAttr.GetProcedureName, sqlParameters, commandType : CommandType.StoredProcedure); var tracking = result.ReadSingleOrDefault <T>(); //todo: implement reading of custom fields //var customFields = result.Read(); return(tracking); } }
public async Task <TestTrackingDto> GetTestTracking(TrackingParameter parameter) { return(await GetTracking <TestTrackingDto>(parameter)); }
public async Task <AliquotTrackingDto> GetAliquotTracking(TrackingParameter parameter) { return(await GetTracking <AliquotTrackingDto>(parameter)); }
public async Task <MaterialTrackingDto> GetMaterialTracking(TrackingParameter parameter) { return(await GetTracking <MaterialTrackingDto>(parameter)); }
public async Task <SourceTrackingDto> GetSourceTracking(TrackingParameter parameter) { return(await GetTracking <SourceTrackingDto>(parameter)); }
public async Task <TestTrackingDto> GetTest([FromBody] TrackingParameter parameter) { return(await _trackingDbService.GetTestTracking(parameter)); }
public async Task <MaterialTrackingDto> GetMaterial([FromBody] TrackingParameter parameter) { return(await _trackingDbService.GetMaterialTracking(parameter)); }
public async Task <SourceTrackingDto> GetSource([FromBody] TrackingParameter parameter) { return(await _trackingDbService.GetSourceTracking(parameter)); }