public virtual DbSet Set([NotNull] Type entityType) { Check.NotNull(entityType, "entityType"); // Note: Creating sets needs to be fast because it is done eagerly when a context instance // is created so we avoid loading metadata to validate the type here. return(_sets.GetSet(this, entityType)); }
public void Set_created_using_non_generic_method_is_cached_and_returned() { var context = Mock.Of<DbContext>(); var sets = new ContextSets(); var set = sets.GetSet(context, typeof(string)); Assert.Same(set, sets.GetSet<string>(context)); }
public void Set_created_using_non_generic_method_is_cached_and_returned() { var context = Mock.Of <DbContext>(); var sets = new ContextSets(); var set = sets.GetSet(context, typeof(string)); Assert.Same(set, sets.GetSet <string>(context)); }
public void Non_generic_method_still_creates_new_generic_DbSet() { var context = Mock.Of<DbContext>(); var sets = new ContextSets(); var set = sets.GetSet(context, typeof(string)); Assert.IsType<DbSet<string>>(set); Assert.Same(context.Configuration, set.Configuration); }
public void Non_generic_method_still_creates_new_generic_DbSet() { var context = Mock.Of <DbContext>(); var sets = new ContextSets(); var set = sets.GetSet(context, typeof(string)); Assert.IsType <DbSet <string> >(set); Assert.Same(context.Configuration, set.Configuration); }