P1_TrevorGraham/MvcStoreApplication/Repository/Repository.cs
/// <summary>
/// checks if a location is in the db based on id and name
/// </summary>
/// <param name="location"></param>
/// <returns>bool IsInDb</returns>
checks if a location is in the db based on id and name
checks if a location is in the db based on id and name
public bool LocationIsInDb(Location location)
        {
            return (_dbContext.Locations.ToList().Where(x => x.LocationId == location.LocationId || x.Name == location.Name).Count() > 0);
        }
public bool LocationIsInDb ( Location location ) { return ( _dbContext . Locations . ToList ( ) . Where ( x => x . LocationId == location . LocationId || x . Name == location . Name ) . Count ( ) > 0 ) ; }
checks if a location is in the db based on id and name
checks if a location is in the db based on id and name
None
location
Location
None