Linq to SQL inheritance and Table per Class - approach needed for multiple roles

Posted by Ash Machine on Stack Overflow See other posts from Stack Overflow or by Ash Machine
Published on 2010-04-28T17:41:54Z Indexed on 2010/04/28 17:47 UTC
Read the original article Hit count: 215

Filed under:
|
|

I am using L2S and an inheritance model for mapping Persons against certain roles.

Guy Burstein's excellent blog post explains how to accomplish this:

http://blogs.microsoft.co.il/blogs/bursteg/archive/2007/10/01/linq-to-sql-inheritance.aspx

However, I have a specific case where a Person has multiple roles. For example 'Jane Doe' is a Contact and a Programmer. In this model, she would need two rows in the People table, one as Contact (PersonType = 1) and one as Programmer (PersonType = 3).

If she changes her last name, and that update happens in her role as Contact, I would need to change all instances of 'Jane Doe' to reflect the name change everywhere.

What sort of best approach (improved data structure) could be used to change last name within all roles? Finally, I am hoping to avoid overriding each general form update events to include all instances, but that may be the only way. Any suggestions or approaches appreciated.

© Stack Overflow or respective owner

Related posts about linq-to-sql

Related posts about inheritance