Пример #1
0
        public async Task <FelhasznaloResult> Read([FromQuery] string sid, [FromBody] string maszk)
        {
            var result = new FelhasznaloResult();

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

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

            return(result);
        }
Пример #2
0
        public async Task <FelhasznaloResult> CreateNew([FromQuery] string sid)
        {
            var result = new FelhasznaloResult();

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    result.Result = new List <FelhasznaloDto> {
                        await FelhasznaloBll.CreateNewAsync(_context, sid)
                    };

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

            return(result);
        }