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

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

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

Сводка

Подробности

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