Hi,
It is up to the entityprovider to return the correct instance and it does not really matter what the configuration says. The configuration is used to identify which types your provider supports (so we get your provider when we ask for Club) and you don't need multiple providers to support multiple types.
Later on when your provider is called it is up to you to return the correct instance, if you want that to be type A or type B is up to you. The problem as I see it is to know which type is the correct one, that you will have to do based on let's say, an attribute value of the Club.
For example:public object GetEntityInstance(Type type, DbDataReader reader)
{
if (type == typeof(Club))
{
Club club = new Club(reader);
if(club.GetAttributeValue<string>("clubtype") == "A")
return new ClubA(reader);
else if(club.GetAttributeValue<string>("clubtype") == "B")
return new ClubB(reader);
else
throw new ApplicationException("Unhandled club type");
}else
return null;
}
Ok, so this is not really multiple inheritance, but rather repeated inheritance... I am trying to create more than one class inheriting from the Club module in StarCommunity. I created two classes with one entity provider each, and added the entity providers to the EntityProviders.config file. Unfortunately, I can only get one of them working (it will take over and ClubHandler will always return that class and I will get a cast error).
My question is, how do I inherit the same class more than once?