Exemple #1
0
        private CustomerCredentials toUser(DbCustomerCredentials credential)
        {
            DbCustomer customer = _context.customers.Single(customer => customer.Username == credential.Username);

            if (customer == null)
            {
                return(null);
            }
            DbContactInfo contactInfo = _context.contactInfo.Single(contactInfo => contactInfo.Username == credential.Username);
            Customer      cust;

            cust = customer.toCustomer(contactInfo);
            CustomerCredentials cc = new CustomerCredentials(credential.Password, cust);

            return(cc);
        }