Exemple #1
0
        public bool CreateNewUserWithCard(string cardId, string employeeEmail)
        {
            var newEmployee = new Employee
            {
                Email   = employeeEmail,
                Balance = 0,
                CardUid = cardId
            };

            try
            {
                _context.Add(newEmployee);
                _context.SaveChanges();
                RemoveCardFromNewCards(cardId);
                return(true);
            }
            catch (SqlException error)
            {
                _logger.LogError("While running this error showed up:", error);
                return(false);
            }
        }