开发者

ASP.NET 3.5 with Entity Framework already in use. Best way to call a sproc?

开发者 https://www.devze.com 2023-01-24 10:17 出处:网络
I have a small application that uses Entity Framework to expose information to an oData service.I need to allow my web server to call a SQL sproc for auditing purposes.

I have a small application that uses Entity Framework to expose information to an oData service. I need to allow my web server to call a SQL sproc for auditing purposes.

What technology should I use to keep the app "clean"?

  • Should I follow these directions for EF3.5?

  • Should I use ADO.NET?

  • Linq2SQL?

    开发者_如何学Go

  • Should I upgrade to .NET 4 so I can take advantage of the better EF?

What makes the most sense from a supportability perspective?


This is subjective, but I'd go for EF4.


Well the only real difference between ADO.NET/L2SQL/EF is that EF4 allows mapping of stored procedures to complex types.

What this means is you can map the result of a stored proc directly to a POCO, and align it with your domain model.

This is not possible with ADO.NET / L2SQL, and for that reason alone i'd also recommend EF4.


i would also recommend EF4 because there are so many things in EF4 that actually works. Also there has been lot of improvements in sql generation for EF4.

0

精彩评论

暂无评论...
验证码 换一张
取 消