Entity Framework 4 / POCO - Where to start? [closed]

扶醉桌前 提交于 2019-11-26 19:16:29

These articles might be of interest...the series really gets into the advantages and disadvantages of a POCO approach.

http://blogs.msdn.com/b/adonet/archive/2009/05/21/poco-in-the-entity-framework-part-1-the-experience.aspx

http://blogs.msdn.com/b/adonet/archive/2009/05/28/poco-in-the-entity-framework-part-2-complex-types-deferred-loading-and-explicit-loading.aspx

http://blogs.msdn.com/b/adonet/archive/2009/06/10/poco-in-the-entity-framework-part-3-change-tracking-with-poco.aspx

In these articles the author mentions future articles that describe best practices in implementing Repository and Unit of Work patterns, but I can't find them. These articles are well written and I'd like to read more from this author.

I've come across this: http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-code-only-for-the-entity-framework.aspx

Which gives you step-by-step for code first. It does require the CTP 3 for EF4 (Download linked from that article).

This is pretty close to what I was after (although ideally a solution that doesn't rely on a CTP would've been preferable)

I do recommend that you take a half hour or so and generate a stable EF1.0 model in your current VS. That will get you a long way towards understanding the metaphors and concepts of EF 4.0. Just whip up a simple Customer, Products and Orders db...I recommend doing your own and not using Northwind.

This is a great question, but tough to keep up to date as Entity Framework continues to mature. Probably the best place to start that will stay up to date into the future is Microsoft's EF page.

A few other links I found helpful while Googling (focused on Code First):

You can take Lerman's book or something simplier like "Pro linq object-relational mapping". All concepts are still the same with POCO, except that now you should disable code generation and map directly to your model in edmx csdl (or create your own POCO generator). All mapping principles are the same also. Anyhow in run time you are working with proxy which is derived from your POCO object so you should concern about interception support (virtualization of your POCO properties).

Here's a walkthrough on the POCO Template for the Entity Framework that looked pretty good. You might also want to check out the ADO.NET team blog. If you want to start at the beginning(EF v1.0) as a base for your EF knowledge, I found Julia Lerman's Programming Entity Framework book very complete.

Dont have the rep to comment on an answer, but here is a follow up to Jinkinz answer:

Using Repository and Unit of Work patterns with Entity Framework 4.0:

http://blogs.msdn.com/b/adonet/archive/2009/06/16/using-repository-and-unit-of-work-patterns-with-entity-framework-4-0.aspx

Julia Lerman has a nice series of introductory videos, about 10 minutes each. They're introductory, but there are plenty of practical tips that get some potential learning roadblocks out of the way. I especially liked her demonstration of watching the actual SQL go by using SQL Server Profiler.

If you are going to use disconnected cenarios, I recommend you to read Julie Lerman book: "Programming DbContext", in special Chapter 4.

I found a lot of examples in blogs, etc, but almost all of them are about connected cenarios.

I'm starting too. and these book helped me a lot. By the way, I bought her three books.

I was looking for the same answers and came across http://www.dotnetcurry.com/ShowArticle.aspx?ID=599

At the end of the link, there are few links which will get you rolling with Entity Framework 4.

Hope this helps

Wow, lots of answers. How about an example which contains a tweaked version of T4 templates that generate POCO + interfaces + repositories altogether?

https://entityinterfacegenerator.codeplex.com

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!