예제 #1
0
        public async Task <PenztarResult> ReadByCurrencyOpened([FromQuery] string sid, [FromBody] int penznemkod)
        {
            var result = new PenztarResult();

            using (var tr = await _context.Database.BeginTransactionAsync())
                try
                {
                    result.Result = await PenztarBll.ReadByCurrencyOpenedAsync(_context, sid, penznemkod);

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

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

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

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

            return(result);
        }