public ActivationCodeEntity Add(ActivationCodeEntity activationCode) { _context.ActivationCodes.Add(activationCode); _context.SaveChanges(); return(activationCode); }
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); }