Last post Feb 26, 2009 06:16 PM by rdwlaz
Dec 19, 2008 06:30 PM|Nannette|LINK
Curt_c: I don't find one approved, so it wasn't a duplicate, so I think you mistakenly deleted it.
Here it is again:
The Entities framework doesn't handle mapping to stored procedures other than insert update delete, etc. Why wasn't this built-in?
I've found the EF Extensions:
But that not being built-in concerns me, because how forward compatible will it be? And I have to manually go get updates, etc. Just one more "product" to worry about. Plus the tutorial is in C# and doesn't address my needs of running my type of stored procedure.
Is this what we're expected to use if we want to use stored procedures? How long?
Plus in the above tutorial, it says: " Alazel Acheson, a developer on the ADO.NET team, wrote a more extensive connection scope utility that you can find here ."
So now there is yet ANOTHER library to worry about!
What is one supposed to do about mapping to stored procedures in the ado.net entities?
Dec 26, 2008 01:59 AM|rcfearn|LINK
Dec 26, 2008 05:55 AM|Nannette|LINK
I had done that, but it gives me nothing to work with.
Maybe I just don't know how to use it.
How do I use it after I do the Create Function Import?
Dec 31, 2008 06:34 PM|Nannette|LINK
When I use "Create Function Import" it adds this to my edmx model code:
<Function Name="MenuReorder" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
<Parameter Name="parentMenuId" Type="int" Mode="In" />
<Parameter Name="menuId" Type="int" Mode="In" />
<Parameter Name="pageMovedBackwards" Type="bit" Mode="In" />
<Parameter Name="parentMenuId" Mode="In" Type="Int32" />
<Parameter Name="menuId" Mode="In" Type="Int32" />
<Parameter Name="pageMovedBackwards" Mode="In" Type="Boolean" /></FunctionImport></EntityContainer>
<FunctionImportMapping FunctionImportName="MenuReorder" FunctionName="Oop4Model.Store.MenuReorder" /></EntityContainerMapping>
But I don't understand how to use it. How do I use it?
I looked up on MSDN:
Using db As AdvWksSalesEntities =
As Integer = 43659
For Each order
As SalesOrderDetail _
but when I try to access the stored procedure methods, they don't come up as part of my "db"...
Using db As Oop4Entities = New Oop4Entities
db. ' doesn't list MenuReorder or any variation as an option....
Won't someone please help?
Jan 01, 2009 01:24 AM|rcfearn|LINK
Jan 05, 2009 06:03 PM|simmdan|LINK
The Entity Framework support for read stored procedures is not as full featured as we would like in the first release of the product. As was mentioned above you can have stored procedures which will read from the database but the built in support requires
that those procedures return entities--if you want to have a stored procedure that returns some other structure, things get more complicated. This and a number of other deficiencies in this area will be resolved in the next release of the entity framework
which will ship with .net 4.0/vs2010.
To address your specific question of whether or not the EFExtensions will be supported in a backwards compatible manner, the answer is that there is no such guarantee. EFExtensions and a number of other samples and libraries built on top of the entity
framework and released on code gallery and other places are not supported, but are just attempts by the team and others to help folks be more productive with the EF in its first release. We are working on creating a new system which we hope to roll out in
a few months for final release starting with vs 2010 where we will have an officially supported "power pack" of sorts that can ship features which have not made it into the official product. The idea if we can pull it off is that these features will be fully
supported and will just roll into the next major release of the product allowing folks to depend on them in a way which is harder than what is available with samples or the like.
Jan 09, 2009 02:47 PM|geordiejenner|LINK
then how do you recommend best to access the stored procedures, and is there a walk through example of this
Jan 09, 2009 03:15 PM|Nannette|LINK
So in short, EF as it stands now is worthless for real life use.
I guess I've wasted several weeks of my life rewriting my code for a technology that should have been released as incomplete and only in beta.
Jan 23, 2009 01:56 PM|Pallen2412|LINK
Jan 24, 2009 12:33 AM|rcfearn|LINK
entity data framework
mapping dummy tables
Jan 30, 2009 08:00 PM|kgolding|LINK
I have spent some time trying to use the EF in a new project and I was initially very excited as I had the data model up and off to a very promising start in no time, however, as I start trying to build an application around it, I keep encountering issues.
I hit the function mapping issue mentioned above as well as models getting corrupted after updating and inconsistent behavior from various methods calls. In addition to that, I have also seen odd or at least unexpected caching behavior, and the framework
ignoring database configuration settings for reasons I still haven't figured out. I am starting to fear this thing. Frankly, at this point I would have been better off just using the Enterprise Library. I think the EF has great potential, and I really liked
the experience of setting up and the ability to update the mode from a database, but I agree with a few of the posts above, it should still be a beta product. I am sure I am still struggling with aspects of this, however, I think it would be nice to include
some, or at least one of the main underlying database methods, like ExecuteNonQuery(sql) that would run directly against the underlying database.
entity data framework
Entity Data Model
Feb 24, 2009 06:56 PM|rdwlaz|LINK
Is it possible to map a Oracle Ref Cursor (output param) to an Entity?
Take this simple example:
Let's say I have an entity called Customer with id (key),
name, address. I have a stored procedure called get_all_customers.
p_cursor OUT t_cursor
OPEN p_cursor FOR
id, name, address
Using the "Create Function Import" I created a Function called GetAllCustomers and set the return type to the Customer entity. How can I map the columns from the cursor to the Customer entity. Is this possible? I get Error 11009: Property '<COLUMNNAME>'
is not mapped.
Entity Data Model
Feb 26, 2009 06:16 PM|rdwlaz|LINK
Just to follow up this blog gave me the solution to my question thanks to rcfearn.