I have a simple linq query that unionizes two tables that implement the same interface.
For this example, lets say IAnimal.
var q = (from d in db.Dogs
where d.AnimalID = PetID
select d.Name)
.Union
(from c in db.Cats
where c.AnimalID = PetID
select c.Name)
So if the dog portion has no members, q gets assigned {"", {whatever is in cat}}. Is there a way to remove that empty record without doing .Where(x=>x!="" | x!= String.Empty)
after the query?
I know its not that big of a deal, but it seems like there should be a better way?