Exemple #1
0
        public async Task <HelysegResult> Read([FromQuery] string sid, [FromBody] string maszk)
        {
            var result = new HelysegResult();

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

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

            return(result);
        }
Exemple #2
0
        public async Task <HelysegResult> Get([FromQuery] string sid, [FromBody] int key)
        {
            var result = new HelysegResult();

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

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

            return(result);
        }