public async Task <Int32Result> Update([FromQuery] string sid, [FromBody] ParticioDto dto) { var result = new Int32Result(); using (var tr = await _context.Database.BeginTransactionAsync()) try { result.Result = await ParticioBll.UpdateAsync(_context, sid, dto); tr.Commit(); } catch (Exception ex) { tr.Rollback(); result.Error = ex.InmostMessage(); } return(result); }
public async Task <ParticioResult> Get([FromQuery] string sid) { var result = new ParticioResult(); using (var tr = await _context.Database.BeginTransactionAsync()) try { result.Result = new List <ParticioDto> { await ParticioBll.GetAsync(_context, sid) }; tr.Commit(); } catch (Exception ex) { tr.Rollback(); result.Error = ex.InmostMessage(); } return(result); }