Entity Framework, here we go

by Misty Rae McKinley 23. June 2010 00:45

Working on our first project where Entity Framework is playing a huge role, and have to say that it is quite enjoyable, outside of the little quirks... But what else isn't that true for.

Some of the biggest gotchas we have found so far, in no particular order, except the one I remembered them in:

  1. If you have a table called app_Blah, that has a column called Blah, and in your EF model you want the entity to be called Blah, you are screwed. We were able to fix this by altering the table to use a more sensible field name, like Name, and then updated the model so that it saw the new Name column. I then manually deleted the Blah column from the entity and was able to name the entity what I wanted to.
  2. EF doesn't do lazy loading. So stop being lazy and when you want to load the data from a relationship, check the IsLoaded property of the object and if not loaded, the call Load.

 

Tags:

programming

Add comment




  Country flag
biuquotesnippet
  • Comment
  • Preview
Loading


Powered by BlogEngine.NET 2.0.0.36