Esempio n. 1
0
        public async Task AddTransactionAsync(OfferTransaction transaction)
        {
            if (transaction == null)
            {
                throw new ArgumentNullException(nameof(transaction));
            }

            DL.OfferTransactions dbTr = _mapper.Map <DL.OfferTransactions>(transaction);
            dbTr.CreateDate = DateTime.UtcNow;

            _dbContext.OfferTransactions.Add(dbTr);
            await _dbContext.SaveChangesAsync();
        }
Esempio n. 2
0
        public async Task CreateAsync(string userId, BL.Model.Place place)
        {
            if (place == null)
            {
                throw new ArgumentNullException(nameof(place));
            }

            DL.Place pl = _mapper.Map <DL.Place>(place);

            var user = new AspNetUsers()
            {
                Id = userId
            };

            pl.AspNetUsers.Add(user);

            _dbContext.AspNetUsers.Attach(user);
            _dbContext.Place.Add(pl);
            await _dbContext.SaveChangesAsync();
        }
Esempio n. 3
0
 public Task CreateAsync(PointTransaction transaction)
 {
     DL.PointTransactions pTr = _mapper.Map <DL.PointTransactions>(transaction);
     _dbContext.PointTransactions.Add(pTr);
     return(_dbContext.SaveChangesAsync());
 }