我想将LINQ表达式树转换为SQL语句,我不想为此编写自己的代码.
例:
var query = from c in Customers
where c.Country == "UK" &&
c.City == "London"
select c);
Run Code Online (Sandbox Code Playgroud)
至
SELECT ... FROM Customers AS c WHERE c.Country = "UK" AND c.City = "London"
Run Code Online (Sandbox Code Playgroud)
我知道DataContext.Log,但我想用:
query.ToSqlStatementString()
Run Code Online (Sandbox Code Playgroud) 我在'default web site\orchard'上安装了Asp.NET Application ...可以在http:// localhost/orchard上访问,我想使用URL Rewrite.我添加了规则:
<rewrite>
<rewriteMaps>
<rewriteMap name="Blogger">
<add key="/aaa" value="/tags/tag1" />
</rewriteMap>
</rewriteMaps>
<rules>
<clear />
<rule name="Rewrite rule1 for Blogger" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{Blogger:{REQUEST_URI}}" pattern="(.*)" />
</conditions>
<action type="Redirect" url="{C:1}" appendQueryString="false" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
Run Code Online (Sandbox Code Playgroud)
但是当我转到http:// localhost/orchard/aaa时,会返回错误404而不是重定向到http:// localhost/orchard/tags/tag1.
当我把我的Web应用程序放在网站重定向的根文件夹中时.http:// localhost/aaa被重定向到http:// localhost/tags/tag1.
我做错了什么?
感谢帮助.