15,902,032 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Alex-1978 (Top 4 by date)
Alex-1978
27-Jul-18 5:00am
View
Thanks for your comment! It gave me a very important tip.
It was just necessary to add replacement of 'x' parameter in the body of roleActionBody.
I had only made replacement in the parameters of that expression.
I'm a newbie in expression tree, so it was not obvious for me :)
Thanks a lot!
Alex-1978
26-Jul-18 3:44am
View
Yeah, this is what I'm trying to do in run-time using Expression class.
I'm creating expressions for each step:
Expression<Func<Action, bool>> expr1 = z => !x.IsActive || z.IsActive;
Expression<Func<Role, IEnumerable<action>>> expr2 = y => y.Actions.Where(...)
Expression<Func<Widget, IEnumerable<action>>> expr3 => x => x.Roles ...
but this code is not written directly in C#, it is being created on the fly and the issue is that parameter 'x' from expr3 is not bound to the context of call of expr1.
I'm using ExpressionVisitor to replace parameters in the final expression, but since expr1 is not accepting 'x' as a parameter, it doesn't have access to it.
The question really is, which mechanism must be used to pass 'x' into expr1 ?
Is it a closure ? If yes, is it possible to create a clouse for a node in the expression tree ?
I've found no information about it till now.
Alex-1978
25-Jul-18 15:37pm
View
Thanks for your comment.
Could you please clarify, which nested loops are you talking about ?
Alex-1978
24-May-12 10:35am
View
I've found out a part of a solution for this problem: I've overridden GetWebRequest() method of the web-client and implemented adding of 'Accept-Encoding' header, so now I can see 'Accept-Enconding: gzip, deflate' is sent to the server, but the answer is still not compressed.
Looks like the web-service needs to be configured in a way to support this.
I saw an advice to add the following section into web.config:
<pre lang="xml"><system.webServer>
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>
<dynamicTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="text/xml" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="*/*" enabled="false"/>
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="text/xml" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="*/*" enabled="false"/>
</staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true"/>
</system.webServer></pre>
but it didn't help me.
Can anybody say what it is necessary to do ?