I have a library with a class called Recipient which has it's own fluent mapping setup within the library.
Now in another project I have created a new class called SentEmail which inherits from Recipient, I want to be able to create a new mapping class file based on the original Recipient map. If I could update the original ClassMap file I would use
JoinedSubClass("ID", m => MAPPING HERE);
However because I can't adjust the original class map I am stuck as to how I can do this.
There must be another way to skin this cat, if anyone has any ideas they would be much appreciated.
Thanks
UPDATE
Also one thing I forgot to mention part of the details in the new SentEmail model class are stored in a seperate table to the Recipient table.
-
If you can't adjust the original mapping at all, then you're out of luck; otherwise you could use the
AddPartmethod to add a separate instance ofJoinedSubClassPart.An aside: your design sounds a bit peculiar.
SentEmaildoesn't sound like it should really inherit fromRecipient.SentEmailwould inherit fromEmail, orSuccessfulRecipientfromRecipient;RecipientandEmailare two separate concepts.John_ : That is a good point thanks James, I have amended the name to be RecipientEmailHistory as it is more related to the recipient than the email. I've also decided that creating a map for the file was unneccesary because it was a read only class so I create a query and transform it into my new model using NHibernate.Transform.Transformers.AliasToBean. Thanks for your assistance.
0 comments:
Post a Comment