コード例 #1
0
        public void ValueGetter_ReturnsCorrectPropertyOrField_ActualValue(string field, string expected)
        {
            var test        = GetTest();
            var valueGetter = FunctionCompiler.CreateValueGetter <Test>(field);

            Assert.Equal(expected, valueGetter(test)?.ToString());
        }
コード例 #2
0
 public BaseDataGridColumn()
 {
     // TODO: move this to cached FunctionCompiler so it doesn't get compiled every time
     valueTypeGetter    = new Lazy <Func <Type> >(() => FunctionCompiler.CreateValueTypeGetter <TItem>(Field));
     defaultValueByType = new Lazy <Func <object> >(() => FunctionCompiler.CreateDefaultValueByType <TItem>(Field));
     valueGetter        = new Lazy <Func <TItem, object> >(() => FunctionCompiler.CreateValueGetter <TItem>(Field));
     valueSetter        = new Lazy <Action <TItem, object> >(() => FunctionCompiler.CreateValueSetter <TItem>(Field));
 }