Example #1
0
        public ActivationCodeEntity Add(ActivationCodeEntity activationCode)
        {
            _context.ActivationCodes.Add(activationCode);
            _context.SaveChanges();

            return(activationCode);
        }
Example #2
0
        public string CreateNew(string email)
        {
            var user = _userService.GetByEmail(email);
            var code = GenerateCode();

            var newActivationCode = new ActivationCodeEntity
            {
                UserId      = user.Id,
                TimeCreated = DateTime.Now,
                Code        = code
            };

            _activationCodeRepository.Add(newActivationCode);

            return(code);
        }