views:

27

answers:

3

By default Navigation Properties in Entity Frameworks creates properties at both the end of associations, now the problem I am facing is, I want to mark some associations to generate properties at both ends and some to generate only for child of association. Ok I know I can customize the template, but I have no way to store any information inside EDMX editor where I can tell my code generator to skip generating specific navigation property for current class.

I wish there would be something in property pane or I can extend to add some more property in it.

Update: I know I can abuse documentation property, but I am thinking of some way where I can create Visual Studio Extension (write lots of code using VS SDK) and make it integrate with EDMX editor like we add attached properties in WPF.

A: 

See this article you can add whatever you want to the EDMX files ( its just xml ;) ). He adds an extension property myExtensions:Index so he can generate custom code to do indexing.

Nix
Thanks, I know this, but its kind of little bad, I would be happy if I can make some sort of editor which gives me some visual clue while editing in property browser etc. Or I guess I have to think of making a whole new editor itself.
Akash Kava
A: 

You could abuse the Documentation property. It is not used in the T4 template (not in the POCO template anyway) so you could put some directives in there.

Jappie
+1  A: 

Depending on how deep you want to go, you might find some pointers in this article, which uses the Entity Data Model Designer Extension Starter Kit.

Alex Paven
Well thanks for pointing in right direction, let me try if i can make this work or not.
Akash Kava
Your link is old, I think it was under development before VS 2010, everything is now included in VS 2010, there is no such extensibility for UI, however I found annotations that can be used. Thanks for your link.
Akash Kava