So lets say I have 3 objects Fruit, Apple and Orange. Fruit is the abstract base class for Apple and Orange. When I use session.Store(myApple), it puts it into the Apples co
Awl, You can do it using:
session.Store(apple);
session.Advanced.GetMetadataFor(apple)[Constants.RavenEntityName] = "Fruits";
That is the long way to do so. A much better way would be to add this logic globally, it looks something like this:
store.Conventions.FindTypeTagName =
type => type.IsSubclassOf(typeof(Fruit)) ?
DocumentConvention.DefaultTypeTagName(typeof(Fruit)) :
DocumentConvention.DefaultTypeTagName(type);
That will handle this for everything.