Exemple #1
0
 /// <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));
        }
Exemple #3
0
        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);
        }
Exemple #5
0
        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);
        }