P1_TrevorGraham/MvcStoreApplication/Repository/Repository.cs
/// <summary>
/// checks if the given customer is in the db based on id and username
/// </summary>
/// <param name="customer"></param>
/// <returns></returns>
checks if the given customer is in the db based on id and username
checks if the given customer is in the db based on id and username
public bool CustomerIsInDb(Customer customer)
        {
            if (customer !=null)
            return _dbContext.Customers.ToList().Where(x => x.UserId == customer.UserId || x.Username == customer.Username).Count() > 0;
            return false;
        }
public bool CustomerIsInDb ( Customer customer ) { if ( customer != null ) return _dbContext . Customers . ToList ( ) . Where ( x => x . UserId == customer . UserId || x . Username == customer . Username ) . Count ( ) > 0 ; return false ; }
checks if the given customer is in the db based on id and username
checks if the given customer is in the db based on id and username
None
customer
Customer
None