Esempio n. 1
0
        public async Task <IrattipusResult> Read([FromQuery] string sid, [FromBody] string maszk)
        {
            var result = new IrattipusResult();

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    result.Result = await IrattipusBll.ReadAsync(_context, sid, maszk);

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

            return(result);
        }
Esempio n. 2
0
        public async Task <IrattipusResult> Get([FromQuery] string sid, [FromBody] int key)
        {
            var result = new IrattipusResult();

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

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

            return(result);
        }