I am using LINQ to SQL
and want to add functions to autogenerated EntitySet< TEntity >
collections.
eg.
City.Houses
where Houses
is automatically generated EntitySet < House >
I am using extension method to add extract function to the EntitySet < House >
class
so that I can get something like
City.House.FindByID(id);
but now I also have
City.Bunglows.FindByID(id);
now FindByID
basically does the same thing for both these classes.
Will I have to extend Bunglows
also and implement the same function again. Can't I do some kind of inhertiance on the autogenerated EntitySet< TEntity >
classes??
Commenting on Andrew Hare's answer
But that will make FindByID() available on all EntitySet< TEntity > classes. What if I want to implement that function on these 2 particular entity sets only???