Hello, I managed to put in the title the "tags" of this post as I'll
end up describing the problem in it if I don't.
The situation is:
Given these tables:
- Contacts:
- Id
- ApplicationId
- PersonId
- GroupName
- Description
- ApplicationRole
- Application:
- Id
- some other columns
I want to be able to do something like this:
class ApplicationContact{ public string Description{get;set;} public
Role ApplicationRole{get;set;}}
class IndividualContact : ApplicationContact { public Person
Person{get;set;}}
class GroupContact : ApplicationContact { public string
GroupName{get;set;}}
and in Application:
class Application { ... public IList<ApplicationContact>
Contacts{get;set;}}
How could I do the mappings in order to be able to have that
association in Application?
I've mapped IndividualContact and GroupContact in different classes
mapping to the same table (with a where clause), but then I don't know
how to map the Contacts property in Application (an any map, a bag,
something?). What approach would you use? I would like to not touch
the db, so if a solution exists I would like to apply it.
Note that the Contacts table does not have a discriminator, the
"discrimination" is done by checking if PersonId is null or not
(that's the were clause in each mapping).
Any thoughts?
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.