コード例 #1
0
        public async Task <PenztarTetelResult> Get([FromQuery] string sid, [FromBody] int key)
        {
            var result = new PenztarTetelResult();

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    result.Result = new List <PenztarTetelDto> {
                        await PenztarTetelBll.GetAsync(_context, sid, key)
                    };

                    tr.Commit();
                }
                catch (Exception ex)
                {
                    tr.Rollback();
                    result.Error = ex.InmostMessage();
                }

            return(result);
        }
コード例 #2
0
        public async Task <PenztarTetelResult> Select([FromQuery] string sid, [FromBody] PenztarTetelParam par)
        {
            var result = new PenztarTetelResult();

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    var t = await PenztarTetelBll.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);
        }