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); }
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); }