예제 #1
0
 public void Throws_if_no_field_found()
 {
     using var context = new LazyContext <LazyHiddenFieldEntity>();
     Assert.Equal(
         CoreStrings.NoBackingFieldLazyLoading(nameof(LazyHiddenFieldEntity.SelfRef), nameof(LazyHiddenFieldEntity)),
         Assert.Throws <InvalidOperationException>(
             () => context.Model).Message);
 }
예제 #2
0
 public void Throws_if_sealed_class()
 {
     using var context = new LazyContext <LazySealedEntity>();
     Assert.Equal(
         ProxiesStrings.ItsASeal(nameof(LazySealedEntity)),
         Assert.Throws <InvalidOperationException>(
             () => context.Model).Message);
 }
예제 #3
0
 public void Throws_if_non_virtual_navigation_to_non_owned_type()
 {
     using var context = new LazyContext <LazyNonVirtualNavEntity>();
     Assert.Equal(
         ProxiesStrings.NonVirtualProperty(nameof(LazyNonVirtualNavEntity.SelfRef), nameof(LazyNonVirtualNavEntity)),
         Assert.Throws <InvalidOperationException>(
             () => context.Model).Message);
 }
예제 #4
0
 public void Does_not_throw_if_non_virtual_navigation_to_owned_type()
 {
     using var context = new LazyContext <LazyNonVirtualOwnedNavEntity>();
     var model = context.Model;
 }
 public HomeController(LazyContext ctx)
 {
     _ctx = ctx;
 }