Linq to SQL inheritance and Table per Class - approach needed for multiple roles
- by Ash Machine
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.