public async Task <int> PinFailedAttempt(int creditCardId)
        {
            var creditCard = await _context.CreditCards.FirstOrDefaultAsync(x => x.CreditCardId == creditCardId);

            creditCard.FailedAttempts++;
            await _context.SaveChangesAsync().ConfigureAwait(false);

            return(creditCard.FailedAttempts);
        }
예제 #2
0
        public async Task AddOperation(int creditCardId, int code, string text)
        {
            var operation = new Operations
            {
                CreatedDate   = DateTime.Now,
                CreditCardId  = creditCardId,
                OperationCode = code,
                OperationText = text
            };

            _context.Operations.Add(operation);
            await _context.SaveChangesAsync().ConfigureAwait(false);
        }