In general the domain classes are not meant to query the database and I suggest you to add the GetAllPeople and GetAllPeopleFromLocationA methods in a partial class of your domain context like below:
public List<Person> GetAllPeople()
{
return this.People.ToList();
}
public List<Person> GetAllPeopleFromLocationA(int locationID)
{
return this.People.Where(p => p.LocationID == locationID).ToList();
}
then you could use those methods like:
using (YourContextName context = new YourContextName())
{
foreach (Person person in context.GetAllPeople())
{
// you could access your custom person.PersonName property here
}
foreach (Person person in context.GetAllPeopleFromLocationA(someLocationID))
{
// you could access your custom person.PersonName property here
}
}