0

I wonder if there is some way to connect without using Lazy Loading Virtual attribute? For Code Analysis does not let me use VIRTUAL, and would not assign the SUPPRESS.

Could anyone help me with this? Thank you.

Douglas Costa
  • 27
  • 1
  • 9
  • possible duplicate of [Syntax for virtual members](http://stackoverflow.com/questions/4776049/syntax-for-virtual-members) – Colin Nov 14 '13 at 09:42
  • Are you getting a "virtual call in constructor" warning? Either use a private setter or a backing field. http://stackoverflow.com/questions/4776049/syntax-for-virtual-members – Colin Nov 14 '13 at 09:44

1 Answers1

0

Entity Framework lazy loading works by creating instances of dynamic proxy types which derive from your types and override their virtual properties. The out-of-the-box lazy loading therefore requires those properties to be virtual.

Steve Wilkes
  • 7,085
  • 3
  • 29
  • 32