public async Task <AfaKulcsResult> Read([FromQuery] string sid, [FromBody] string maszk) { var result = new AfaKulcsResult(); using (var tr = await _context.Database.BeginTransactionAsync()) try { result.Result = await AfakulcsBll.ReadAsync(_context, sid, maszk); tr.Commit(); } catch (Exception ex) { tr.Rollback(); result.Error = ex.InmostMessage(); } return(result); }
public async Task <AfaKulcsResult> CreateNew([FromQuery] string sid) { var result = new AfaKulcsResult(); using (var tr = await _context.Database.BeginTransactionAsync()) try { result.Result = new List <AfakulcsDto> { await AfakulcsBll.CreateNewAsync(_context, sid) }; tr.Commit(); } catch (Exception ex) { tr.Rollback(); result.Error = ex.InmostMessage(); } return(result); }