【发布时间】:2009-11-27 10:21:28
【问题描述】:
在我的数据库中,每个表都属于一个模式(例如 Person。)我正在使用 Fluent NHibernate 和 Automapping,我的问题是如何设置我想要使用的模式。
【问题讨论】:
在我的数据库中,每个表都属于一个模式(例如 Person。)我正在使用 Fluent NHibernate 和 Automapping,我的问题是如何设置我想要使用的模式。
【问题讨论】:
使用convention,特别是IClassConvention。
【讨论】:
public class SchemaConvention : IClassConvention
{
public void Apply(IClassInstance instance)
{
instance.Schema("schemaNameGoesHere");
}
}
【讨论】: