コード例 #1
0
        public void SaveAccountConfirmation(AccountConfirmationInfo accountConfirmationInfo)
        {
            Data.AccountConfirmation accountConfirmation = ConvertToDb(accountConfirmationInfo);

            _context.AccountConfirmations.Add(accountConfirmation);
            _context.SaveChanges();
        }
コード例 #2
0
        //public void DeleteAccountConfirmation(int accountId)
        //{
        //    Data.AccountConfirmation accountConfirmation = _context.AccountConfirmations.Where(x => x.AccountId == accountId).FirstOrDefault();

        //    if (accountConfirmation != null)
        //    {
        //        _context.AccountConfirmations.Remove(accountConfirmation);
        //        _context.SaveChanges();
        //    }
        //    else
        //    {
        //        throw new ArgumentNullException();
        //    }
        //}

        public AccountConfirmationInfo ConvertToFacade(Data.AccountConfirmation accountConfirmation)
        {
            return(new AccountConfirmationInfo
            {
                Id = accountConfirmation.Id,
                Token = accountConfirmation.Token,
                AccountId = accountConfirmation.AccountId
            });
        }
コード例 #3
0
        public void DeleteAccountConfirmation(int id)
        {
            Data.AccountConfirmation accountConfirmation = _context.AccountConfirmations.Find(id);

            if (accountConfirmation != null)
            {
                _context.AccountConfirmations.Remove(accountConfirmation);
                _context.SaveChanges();
            }
            else
            {
                throw new ArgumentNullException();
            }
        }