Another workaround would be for the Cat class and Dog class to get the same base class, which then bears the name.
Here is an example
public class Pet
{
public string Name {get; set;}
}
public class Dog : Pet {...}
public class Cat : Pet {...}
In your DataContext object, create a GetPets () method, like this one:
public IEnumerable<Pet> GetPets()
{
return Cats.Cast().Union( Dogs.Cast() );
}
Then use LINQ for pets in the DataContext.
var results =
(from p in _dataContext.GetPets()
where p.Name.Contains(search)
select p);
, u .
{}