sql server - Linq-To-SQL Legacy Relation Mapping -
I am trying to get Linq2SQL to work with my legacy database. I currently have a note table which is normal for some different entities and has been mapped: I, who design this database, instead of mapping a connection table of each unit type, they have a type of column (A varchar yuck!) As a single relationship table.
How do I map the notes in Foo and Bar? Is it also possible I am not seeing light? I tried two sections FooNotes and BarNotes which passed the RelateNotes and then mapped the type field as pigment.
It does not work and I get the following error.
Poor storage property: '_EntityID' member 'at TestLinq.BarNotes. EntityID '.
Before realizing this possible, I do not want to go very far from the Linq2SQL road. I do not have permission to change the database too much.
Many thanks,
I included a domain model based layered architecture Will consider expanding the design of your app.
In this way, you can create a domain model that meets the requirements of the system while mapping works down. For example, you may have a general interface for data access layer which gives mapped organizations. An implementation of this interface can be made for the old 'string-equality' M2M relationship in the heritage database. One day when you are ready to dig legacy databases, a new implementation can be made for a separate AR-DB model, which will allow your domain model (object model) and high layers (services, UI etc) to remain unchanged. (Because they use all common interfaces.).
In your object model, you can define each object that requires notes and each of them has notes collection for each instance. for example. Fu has a collection of notes; There is a collection of notes in the bar, your repository interface will look after these entities return, but there will be concern about the implementation of the repo how it reads and remains in DB.
Comments
Post a Comment