我希望我的应用程序中的某些URL具有不同的连接限制.某些URL接受文件上载,并且需要具有较大的连接超时.所有其他URL都需要更小的超时,以防止拒绝服务而不浪费资源.
目前我在IIS中为整个站点设置了连接超时属性为60分钟.然后我在web.config中这样做了:
<system.web>
<httpRuntime executionTimeout="480" maxRequestLength="1024" />
</system.web>
<location path="FileUpload/WriteFile.rails">
<system.web>
<httpRuntime executionTimeout="3600" maxRequestLength="512000" />
</system.web>
</location>
Run Code Online (Sandbox Code Playgroud)
所以我希望这会将所有URL设置为8分钟超时,并允许WriteFile.rails URL运行60分钟.相反,允许所有URL运行60分钟.如何让IIS执行我想要的操作?
你如何传递Nhibernate HQL中'in'子句的列表?
例如
// data input from the user interface, not known at compile time
object[] productIds = {1, 17, 36, ... };
string hqlQuery = @"
from Product as prod
where prod.Id in ( ? )";
HqlBasedQuery query = new HqlBasedQuery(typeof(Product), hqlQuery, productIds)
ActiveRecordMediator.ExecuteQuery(query);
Run Code Online (Sandbox Code Playgroud)
现在,这不会起作用,就像我希望的那样!我真的坚持做这样的事情:
// data input from the user interface, not known at compile time
object[] productIds = {1, 17, 36, ... };
string hqlQuery = @"
from Product as prod
where prod.Id in ( {0} )"; …
Run Code Online (Sandbox Code Playgroud)