Question

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!

Was it helpful?

Solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top