测试 Fluent NH 映射
我正在测试 Fluent NH 映射,但遇到一个问题:
代码:
[TestMethod()]
public void FilterMapConstructorTest()
{
new PersistenceSpecification<Filter>(session)
.CheckProperty(c => c.Id, 1)
.CheckProperty(c => c.FilterValue, "1")
.CheckProperty(c => c.IdAttribute, 1)
.CheckProperty(c => c.Type, Filter.FilterType.Equals)
.VerifyTheMappings();
}
De 编译器无法识别变量“session”,我应该声明它,还是导入任何 using?
感谢您抽出时间。
此致
I'm testing a Fluent NH mapping and I have a problem:
The code:
[TestMethod()]
public void FilterMapConstructorTest()
{
new PersistenceSpecification<Filter>(session)
.CheckProperty(c => c.Id, 1)
.CheckProperty(c => c.FilterValue, "1")
.CheckProperty(c => c.IdAttribute, 1)
.CheckProperty(c => c.Type, Filter.FilterType.Equals)
.VerifyTheMappings();
}
De compilator don't recognice the variable "session", I should declare this, or import any using?
Thank's for your time.
Best Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在使用它之前,您实际上需要从会话工厂获取一个新的 NHibernate 会话。下面是一个更详细的示例:
You need to actually get a new NHibernate session from your session factory before you can use it. Below is a more detailed example: