4

I am looking for a solid tutorial on using the Entity Framework with POCO (ie. not using the designer) using MySQL as the back-end. I am looking for something that is semi-in-depth covering stuff like attributes (like how to map a database table/field name to a class/field name that is different). Also I am looking for C#, not VB. Does anyone know of any such tutorials?

tereško
  • 58,060
  • 25
  • 98
  • 150
ryanzec
  • 27,284
  • 38
  • 112
  • 169
  • i think your looking for "code-first", where there is no EDMX/designer. Most EF tutorials focus on SQL Server (of course, since both are MS products). But since your coding against the model, and not the database - it shouldn't be too different with MySQL. Just google "Entity Framework 4 Code First". – RPM1984 Dec 23 '10 at 01:27

1 Answers1

4

For EF with MySQL, check this other question:
Using MySQL with Entity Framework
Basically you need to get a connector from MySQL and work normally from there.

For POCOs, either you do code the mappings, and then I assume you use EF 4 Futures CTP 5 recently releaed, or you use the designer, and this is what is normally in EF 4.

If the meant is default EF 4 POCO support, or POCO template in EF CTP5, those should be helpful reads:

http://thedatafarm.com/blog/data-access/agile-entity-framework-4-repository-part-1-model-and-poco-classes/ (the entire series) Generally http://thedatafarm.com/blog/search?q=poco or if page is too slow http://www.google.com.au/#q=poco+site:thedatafarm.com

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

If you are using the code only way, you need to realize it's pre-release and has some issues when working with.

Community
  • 1
  • 1
Meligy
  • 35,654
  • 11
  • 85
  • 109