Example #1
0
        public AuthorizedEmail RemoveAuthorizedEmail(string emailToRemove)
        {
            AuthorizedEmail authEmailToDelete = GetByEmail(emailToRemove);

            if (authEmailToDelete != null)
            {
                context.AuthorizedEmails.Remove(authEmailToDelete);
                context.SaveChanges();
            }
            return(authEmailToDelete);
        }
Example #2
0
        public AuthorizedEmail AddAuthorizedEmail(string newAuthorizedEmail)
        {
            AuthorizedEmail newAuthEmail = new AuthorizedEmail()
            {
                EmailAddress   = newAuthorizedEmail,
                DateOfCreation = DateTime.UtcNow.Date
            };

            context.AuthorizedEmails.Add(newAuthEmail);
            context.SaveChanges();
            return(newAuthEmail);
        }