views:

30

answers:

1

Example code taken from another SO Question

var test = context.Tests
                  .Include("Question.QuestionLocale")
                  .FirstOrDefault();

If your DB schema needed to change for some reason, how could a developer possibly deal with hard-coded values used in a method that takes a string parameter (Include method used as an example), and know there's a problem?

I was under the impression that one of the big selling points of Linq-to-Entities was its strongly-typed nature; once a change in the schema is made, and the corresponding Entity Data Model is updated, you would know right away there is a problem, because your code can't compile anymore. Doesn't this break strong typing? Are there alternatives to using this construct (I'm new to EF - so I have lots of questions, some of which are elementary)?

Thanks!

+1  A: 

Here's one workaround: How to implement an Eager Loading strategy

Craig Stuntz
Excellent, Thanks!
Pwninstein