Example #1
0
        public void ExpressionUsesParentService()
        {
            var service = new SomeService();
            var newExp = InstanceToIndexExpressionMaker<Model>.Replace(0, m => service.GetSomething(m));
            var func = newExp.Compile();
            var retval = func(new[] { new Model() { Id = 7 } });

            Assert.AreEqual(7, retval);
        }
Example #2
0
        public void ExpressionUsesParentService()
        {
            var service = new SomeService();
            var newExp  = InstanceToIndexExpressionMaker <Model> .Replace(0, m => service.GetSomething(m));

            var func   = newExp.Compile();
            var retval = func(new[] { new Model()
                                      {
                                          Id = 7
                                      } });

            Assert.AreEqual(7, retval);
        }