[Fact] // CodePlex 1566 public void Collection_instances_are_created_when_explicitly_loading_related_collections() { using (var context = new CollectionsContext()) { context.Configuration.LazyLoadingEnabled = false; var entity = context.LotsOfCollections.Single(); var entry = context.Entry(entity); entry.Collection(e => e.AnICollection).Load(); entry.Collection(e => e.AnIList).Load(); entry.Collection(e => e.AnISet).Load(); entry.Collection(e => e.AList).Load(); entry.Collection(e => e.AHashSet).Load(); entry.Collection(e => e.ACustomCollection).Load(); entry.Collection(e => e.AGenericCustomCollection).Load(); Assert.Equal(1, entity.AnICollection.Count); Assert.Equal(1, entity.AnIList.Count); Assert.Equal(1, entity.AnISet.Count); Assert.Equal(1, entity.AList.Count); Assert.Equal(1, entity.AHashSet.Count); Assert.Equal(1, entity.ACustomCollection.Count); Assert.Equal(1, entity.AGenericCustomCollection.Count); } }
[Fact] // CodePlex 1566 public void Collection_instances_are_created_when_lazy_loading_related_collections() { using (var context = new CollectionsContext()) { var entity = context.LotsOfCollections.Single(); Assert.Equal(1, entity.AnICollection.Count); Assert.Equal(1, entity.AnIList.Count); Assert.Equal(1, entity.AnISet.Count); Assert.Equal(1, entity.AList.Count); Assert.Equal(1, entity.AHashSet.Count); Assert.Equal(1, entity.ACustomCollection.Count); Assert.Equal(1, entity.AGenericCustomCollection.Count); } }
public CollectionsController(CollectionsContext context) { _context = context; }
public static void SaveRecordCollection() { CollectionsContext.SaveCollectionMetadata(Collections.ToList()); }