Wednesday, January 25, 2012

This is how I learned to use Entity Framework 4.1 POCO

I learned how to code Entity Framework 4.1 POCO data access in the last several months from various web site.  I think it would be nice to post the links here so that others can benefit from them.


* Using this tutorial to learn Code First EF

* Need to first get the ADO.Net Entity Framework 4.1 before you can do CodeFirst EF

 
* Code First does NOT support stored proc.  So you need to either do Stored Proc edmx way, or do it the Old School ADO.Net way.

  
* Found that connection string is ultra-critical for the success of using PoCo EF.


* We are NOT doing auto-pluralize data object name.  And here’s the solution of stopping auto-pluralize data object name:


* Some more reason on why we should use POCO:


* Definite key for the EF POCO object: (GREAT article)

* Encountered multiple filed for foreign key issue?

... well,  this seems to be the right answer

(and yes, some day I will learn how to format my blog better too ... some day ...)

Thursday, January 12, 2012

Razor syntax

Searching Microsoft ASP.Net MVC, you will find a lot of information on how to code the view and controller.  The problem is, though, that those of you who work on ASP.Net MVC 3 usually use Razor rendering engine, and the syntax for constructing these cshtml view pages is different from those that use aspx rendering engine.  So beware all you let-Google-write-most-of-your-code developers.