Изменения документа Сценарии

Редактировал(а) Alexandr Fokin 2025/05/13 13:04

От версии 2.4
отредактировано Alexandr Fokin
на 2023/05/31 09:57
Изменить комментарий: К данной версии нет комментариев
К версии 2.7
отредактировано Alexandr Fokin
на 2023/05/31 10:06
Изменить комментарий: К данной версии нет комментариев

Сводка

Подробности

Свойства страницы
Содержимое
... ... @@ -13,14 +13,8 @@
13 13  |(% style="width:394px" %) |(% style="width:1090px" %)(((
14 14  How do I set a field value in an C# Expression tree?
15 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 -
17 -How do you call a constructor via an expression tree on an existing object?
18 -[[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]]
19 -
20 -How do I set a field value in an C# Expression tree?
21 -[[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]]
22 22  )))
23 -|(% style="width:394px" %)Вызов конструктора|(% style="width:1090px" %){{code language="c#"}}var constructorInfo = t.GetConstructors().First(e => e.Attributes.HasFlag(MethodAttributes.Public));
17 +|(% style="width:394px" %)Вызов конструктора|(% style="width:1090px" %){{code language="c#"}}var constructorInfo = type.GetConstructors().First(e => e.Attributes.HasFlag(MethodAttributes.Public));
24 24  var constructorParameter1 = Expression.Parameter(typeof(bool));
25 25  var constructorExp = Expression.New(constructorInfo, constructorParameter1);
26 26  
... ... @@ -28,7 +28,7 @@
28 28  var constructorDelegate = Expression
29 29   .Lambda<Func<bool, object>>(
30 30   constructorExp,
31 - deletedParameter
25 + constructorParameter1
32 32   )
33 33   .Compile();{{/code}}(((
34 34  How do you call a constructor via an expression tree on an existing object?
... ... @@ -42,12 +42,3 @@
42 42  ==== ====
43 43  
44 44  
45 -----
46 -
47 -==== ====
48 -
49 -
50 -----
51 -
52 -
53 -----