What the hell, where’s my added view?

This behavior may confuse you. You’re adding new shiny view and it’s not added into the model. Where’s the problem?

Well the problem is caused by the fact, that every object in EDM has (must have) key (EntityKey). And because usually you have no one on view the view is added but it’s commented out. Hence if you open your EDMX file in XML editor, you’ll see the comment and you can uncomment it. The designer is trying to infer the key from not null columns, but that’s may not be true in your case. Thus you may need to edit selected columns in <Key> (CSDL) element. Then save and you’re done. You can use the view in your model.

  • Twitter
  • Facebook
  • Share/Bookmark
This entry was posted in .* and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>