You can get a lot of customization from your MetaData file. You can also include filtering and cascading by combining some clauses in that same MetaData file plus some Steve Naughton's cadcading libraries ...
BUT ... How can you get the whole set of Referential Integrity rules from your own ORM (.edmx file) directly from your project model .... automatically?
... can a good part of it (if not all) be done automataically from your own database model (ORM) via T4 or some other code generator?
I ask this because writing cascading MetaData directives can be a little cumbersome the way Naughton's model establishes and also taht it is really difficult to achieve cascading when one of the entities you need to "cascade" or "filter" has many different
"cascading entities" pointing to it?
As can be partially seen in this example, any of the foreign keys (FK) can be a "cascading" one ... any of them !!!
Member
242 Points
480 Posts
How to get Referential Integrity from your model automatically?
Jan 26, 2014 09:56 AM|klca|LINK
Hi,
You can get a lot of customization from your MetaData file. You can also include filtering and cascading by combining some clauses in that same MetaData file plus some Steve Naughton's cadcading libraries ...
BUT ... How can you get the whole set of Referential Integrity rules from your own ORM (.edmx file) directly from your project model .... automatically?
... can a good part of it (if not all) be done automataically from your own database model (ORM) via T4 or some other code generator?
I ask this because writing cascading MetaData directives can be a little cumbersome the way Naughton's model establishes and also taht it is really difficult to achieve cascading when one of the entities you need to "cascade" or "filter" has many different "cascading entities" pointing to it?

As can be partially seen in this example, any of the foreign keys (FK) can be a "cascading" one ... any of them !!!
Carlos N. Porras
(El Slavador)
All-Star
17916 Points
5681 Posts
MVP
Re: How to get Referential Integrity from your model automatically?
Jan 27, 2014 04:03 AM|sjnaughton|LINK
Hi Carlos I have two different Cascading examples now and both work with any depth of cascade, these will be availbe in my open source project soon.
Always seeking an elegant solution.
Member
242 Points
480 Posts
Re: How to get Referential Integrity from your model automatically?
Jan 28, 2014 01:07 AM|klca|LINK
Hi Steve,
Will you do me the favor of providing me the links to these files, please .... ?
Carlos N. Porras
(El Salvador)
All-Star
17916 Points
5681 Posts
MVP
Re: How to get Referential Integrity from your model automatically?
Jan 28, 2014 05:01 AM|sjnaughton|LINK
Drop me an e-mail and I will try and get the latest bit together for you
Always seeking an elegant solution.