Entity framework 3.5, mapping stored procedure results to custom entity

前端 未结 2 1356
隐瞒了意图╮
隐瞒了意图╮ 2021-01-23 07:35

I tried to follow this link to map stored procedures to Custom Entities, but when I did so I could no open the EDMX file in the VS 2008 designer. so looks like it is causing som

相关标签:
2条回答
  • 2021-01-23 07:57

    In VS2010 and EF4 this is extremely easy todo. When you do a function import it there is an extra option for returning the collection as a complex type. Even better there is a feature @ the bottom of the 'Add Function Import' dialog that will attempt get the columns from the stored proc result set. Finally, it gives you the option todo a one-click 'Create New Complex' type based upon the result sets. It appears the EF team saw this as a pain and took all necessary steps to make this easier.

    We have a large project that we are about to start on (large meaning 30+ developers and taking 2+ years to complete). We were weighing the options of using standard ADO.Net, EntityFramwork, or a 3rd party ORM like LLBLGen. What we are seeing so far is that the Entity Framework 4 release is a much more full featured ORM. I would be very skeptical @ using EF in VS2008 mostly because of the issue you are talking about in this post + how EF handled the FK's in the VS2008 release (http://blogs.msdn.com/efdesign/archive/2009/03/16/foreign-keys-in-the-entity-framework.aspx)

    0 讨论(0)
  • 2021-01-23 08:03

    I just successfully solved this problem I was having after following the same walkthrough link you provided. (I suppose this answer is for anyone who finds this unanswered question in their search.)

    My problem was that I was not opening the ssdl file correctly. You MUST open it by right clicking the edmx file in the solutions window --> "open with" --> "xml (text) editor" or else the file will not be built properly after making changes, and you won't be able to see the graphical representation of your model. As long as you complete his tutorial editing ONLY the ssdl section of the file, it will work. Just be careful. Opening the ssdl portion of this file in external programs such as Notepad ++ WILL NOT WORK.

    Hope that helps someone. My problem is now passing SelectedItem property of a listbox displaying an entity query result as a parameter to my makeshift st

    0 讨论(0)
提交回复
热议问题