It doesn't seem to. I haven't dug deep to find out why, but here it is. First, my other email used an old syntax. It should have said this:
mapping
.DiscriminateSubClassesOnColumn("typeid")
.SubClass<SubThingyOne>(1, m => { })
.SubClass<SubThingyTwo>(2, m => { });
which is way nicer (you describe that change
here). That first argument to SubClass is an object that serves as the discriminator value. Also, it's relevant to my error message that my discriminator values are integers. Anyway, the result I get from querying is:
Conversion failed when converting the varchar value 'MyNamespace.SubThingyOne' to data type int.
which suggests it's not honoring the discriminator value at all and just passing in the type string.
I don't at all mind digging into the generated mappings and working out the fix. But first I wanted to make sure I'm fixing the right thing, since presumably it was deprecated with good reason. My proposal is this:
1. Fix it if it's broken
2. Undeprecate SubClass()
3. Add an overload SubClass(object discriminatorValue)
Does that sound right? Is there a different way I should tackle it?
-Isaac