FluentNHibernate 是否支持 SQL Server Compact Edition 4.0?
我知道他们支持 SQL CE。我认为他们会达到3.5???我刚刚下载了 CE 4.0,我想在我的项目中测试它,但我无法在 FluentNHibernate 中正确配置它...
如果支持 4.0:
我必须下载什么版本并且可以有人给我一个如何实施的例子吗?
I know they support SQL CE. I think they go up to 3.5??? I just downloaded CE 4.0 and I wanted to test it out in my project but I can't get it configured right in FluentNHibernate...
If 4.0 is supported:
What version do I have to download and could someone give me an example of how to implement it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
FNH 支持 CE 4.0,请尝试此配置:
应通过 AddFromAssembly 添加具有实体映射的程序集。 DatabaseFileName.sdf 是数据库文件名的路径和文件名。路径可以是绝对路径或相对于应用程序的工作目录(Windows 应用程序:System.AppDomain.CurrentDomain.BaseDirectory;Web 应用程序:System.AppDomain.CurrentDomain.RelativeSearchPath)。
在 FNH1.0、NH2.1 和 SQL Server CE 4.0 上测试。
编辑:
数据库文件必须由数据库引擎创建:
以下是 CE 3.5 的示例,但它也应该适用于 CE 4.0:http://nhdatabasescopes.codeplex.com/SourceControl/changeset/view/f9e824a457e8#DatabaseScopes%2fMsSqlCeInFilePrivateScope.cs。
FNH supports CE 4.0, try this configuration:
Assemblies with your entity mappings should be added via AddFromAssembly. DatabaseFileName.sdf is path and file name of the database file name. Path can be or absolute or relative to working directory of the application (windows application: System.AppDomain.CurrentDomain.BaseDirectory; web application: System.AppDomain.CurrentDomain.RelativeSearchPath).
Tested on FNH1.0, NH2.1 and SQL Server CE 4.0.
EDIT:
The database file must be created by the database engine:
Here is an example for CE 3.5 but it should work with CE 4.0 as well: http://nhdatabasescopes.codeplex.com/SourceControl/changeset/view/f9e824a457e8#DatabaseScopes%2fMsSqlCeInFilePrivateScope.cs.