转换我的 Web.Config 时,我遇到了下一个问题:
源文档中没有与“/configuration/system.web/authorization/allow[@roles='WhateverGroupNameRenamedForProd']”匹配的元素
这是我的 Web.Config:
<system.web>
<compilation targetFramework="4.5.2" debug="true" />
<httpRuntime targetFramework="4.5" />
<authorization>
<allow roles="WhateverGroupName" />
<deny users="*" />
</authorization>
Run Code Online (Sandbox Code Playgroud)
和Web.Production.Config:
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<authorization>
<allow roles="WhateverGroupNameRenamedForProd" xdt:Transform="SetAttributes" xdt:Locator="Match(roles)"/>
</authorization>
Run Code Online (Sandbox Code Playgroud)
我做错了什么?提前致谢 :)
我想从sysdate中减去"X"天和"X"分钟,其中days和minutes是一个整数作为输入参数.例如,10天5分钟.
我发现很多例子可以减去分钟或小时,但不是几天和几分钟的组合.
select sysdate - 5 / 24 / 60 from dual -- will retrieve sysdate minus 5 minutes.
--What about the days?
Run Code Online (Sandbox Code Playgroud)
谢谢!
我正在尝试从数据库更新记录QueryOver.我的代码最初创建一个实体并保存在数据库中,然后在外部数据库上更新相同的记录(从其他程序,手动或在其他机器上运行的相同程序),当我queryOver通过字段更改调用过滤时,查询得到记录,但没有最新的变化.
这是我的代码:
//create the entity and save in database
MyEntity myEntity = CreateDummyEntity();
myEntity.Name = "new_name";
MyService.SaveEntity(myEntity);
// now the entity is updated externally changing the name property with the
// "modified_name" value (for example manually in TOAD, SQL Server,etc..)
//get the entity with QueryOver
var result = NhibernateHelper.Session
.QueryOver<MyEntity>()
.Where(param => param.Name == "modified_name")
.List<T>();
Run Code Online (Sandbox Code Playgroud)
前一个语句获取的集合只有一个记录(好),但是使用旧值而不是"modified_name" 建立了name属性.
我怎么能解决这个问题?一级缓存令我不安?出现同样的问题
CreateCriteria<T>();
Run Code Online (Sandbox Code Playgroud)
我的NhibernateHelper中的会话在任何时候都没有因应用程序框架要求而关闭,只是为session.Save()关联的每个提交创建了事务.如果我打开一个新会话来执行查询显然我从数据库中获得了最新的更改,但设计要求不允许这种方法.
此外,我已经在NHibernate SQL输出中检查了正在执行带有WHERE子句的select(因此Nhibernate命中数据库)但是不更新返回的对象!
这是调用session.Save之后SaveEntity中的代码:完成对Commit方法的调用
public virtual void Commit()
{ …Run Code Online (Sandbox Code Playgroud)