0

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!

Community
  • 1
  • 1
Mark Carpenter
  • 17,445
  • 22
  • 96
  • 149

1 Answers1

1

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

Craig Stuntz
  • 125,891
  • 12
  • 252
  • 273