public async Task <IratResult> Get([FromQuery] string sid, [FromBody] int key) { var result = new IratResult(); using (var tr = await _context.Database.BeginTransactionAsync()) try { result.Result = new List <IratDto> { await IratBll.GetAsync(_context, sid, key) }; tr.Commit(); } catch (Exception ex) { tr.Rollback(); result.Error = ex.InmostMessage(); } return(result); }
public async Task <IratResult> Select([FromQuery] string sid, [FromBody] IratParam par) { var result = new IratResult(); using (var tr = await _context.Database.BeginTransactionAsync()) try { var t = await IratBll.SelectAsync(_context, sid, par.RekordTol, par.LapMeret, par.Fi); result.Result = t.Item1; result.OsszesRekord = t.Item2; tr.Commit(); } catch (Exception ex) { tr.Rollback(); result.Error = ex.InmostMessage(); } return(result); }