/// <summary> /// Finds a context set by Id. /// </summary> /// <param name="contextSetId">The context set id.</param> /// <returns></returns> public ContextSetRule FindContextSetById(string contextSetId) { if (ContextSets != null) { return(ContextSets.FirstOrDefault(contextSetRule => contextSetRule.Id == contextSetId)); } return(null); }
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); }