Исходный код вики Сценарии
Версия 2.9 от Alexandr Fokin на 2024/09/10 13:02
Скрыть последних авторов
| author | version | line-number | content |
|---|---|---|---|
| |
2.4 | 1 | |(% style="width:394px" %)Компиляция дерева в делегат|(% style="width:1090px" %){{code language="c#"}}Expression |
| |
1.2 | 2 | .Lambda(expressionValiarble) |
| |
1.4 | 3 | .Compile();{{/code}} |
| |
2.4 | 4 | |(% style="width:394px" %)[[Простое копирование свойств одного класса в другой>>doc:Разработка.NET.C#.Рантайм и типы.Expression tree | Деревья выражений.Сценарии.Простое копирование свойств одного класса в другой.WebHome]]|(% style="width:1090px" %) |
| 5 | |(% style="width:394px" %)[[Маппинг на основе выражения доступа к свойству>>doc:.Маппинг на основе выражения доступа к свойству.WebHome]]|(% style="width:1090px" %) | ||
| 6 | |(% style="width:394px" %)Вызов делегата при построении EpressionTree|(% style="width:1090px" %)Expression Trees and Invoking a Delegate | ||
| |
1.4 | 7 | [[https:~~/~~/stackoverflow.com/questions/2215712/expression-trees-and-invoking-a-delegate>>url:https://stackoverflow.com/questions/2215712/expression-trees-and-invoking-a-delegate]] |
| |
2.4 | 8 | |(% style="width:394px" %)Объявлений локальной переменной в блоке |
| 9 | (без передачи извне)|(% style="width:1090px" %)((( | ||
| |
1.4 | 10 | переменная типа указана из области видимости, но не определена |
| 11 | [[https:~~/~~/question-it.com/questions/717473/peremennaja-tipa-ukazana-iz-oblasti-vidimosti-no-ne-opredelena>>url:https://question-it.com/questions/717473/peremennaja-tipa-ukazana-iz-oblasti-vidimosti-no-ne-opredelena]] | ||
| 12 | ))) | ||
| |
2.4 | 13 | |(% style="width:394px" %) |(% style="width:1090px" %)((( |
| |
1.4 | 14 | How do I set a field value in an C# Expression tree? |
| 15 | [[https:~~/~~/stackoverflow.com/questions/321650/how-do-i-set-a-field-value-in-an-c-sharp-expression-tree>>https://stackoverflow.com/questions/321650/how-do-i-set-a-field-value-in-an-c-sharp-expression-tree]] | ||
| 16 | ))) | ||
| |
2.6 | 17 | |(% style="width:394px" %)Вызов конструктора|(% style="width:1090px" %){{code language="c#"}}var constructorInfo = type.GetConstructors().First(e => e.Attributes.HasFlag(MethodAttributes.Public)); |
| |
2.3 | 18 | var constructorParameter1 = Expression.Parameter(typeof(bool)); |
| 19 | var constructorExp = Expression.New(constructorInfo, constructorParameter1); | ||
| |
1.2 | 20 | |
| |
2.3 | 21 | // Func<bool, object> or Func<bool, T> |
| 22 | var constructorDelegate = Expression | ||
| 23 | .Lambda<Func<bool, object>>( | ||
| 24 | constructorExp, | ||
| |
2.5 | 25 | constructorParameter1 |
| |
2.3 | 26 | ) |
| |
2.4 | 27 | .Compile();{{/code}}((( |
| 28 | How do you call a constructor via an expression tree on an existing object? | ||
| 29 | [[https:~~/~~/stackoverflow.com/questions/16363838/how-do-you-call-a-constructor-via-an-expression-tree-on-an-existing-object>>https://stackoverflow.com/questions/16363838/how-do-you-call-a-constructor-via-an-expression-tree-on-an-existing-object]] | ||
| 30 | ))) | ||
| |
2.9 | 31 | |(% style="width:394px" %)[[Generic enum to int>>doc:.Generic enum to int.WebHome]]|(% style="width:1090px" %) |
| |
2.3 | 32 | |
| |
1.5 | 33 | ==== ==== |
| |
1.2 | 34 | |
| |
1.5 | 35 | ==== ==== |
| |
1.2 | 36 | |
| |
1.5 | 37 | ==== ==== |