C# NHibernate中的SQL Azure联合

C# NHibernate中的SQL Azure联合,c#,sql,nhibernate,azure,azure-sql-database,C#,Sql,Nhibernate,Azure,Azure Sql Database,如何使用NHibernate在SQL Azure连接中使用联合 例如,我希望联合体使用CustomerID分割数据,并且我希望将所有会话调用定向到基于可配置CustomerID的特定联合体。因此,如果您知道客户ID,您只需要使用以下命令连接到其他联合体: use federation CustomerFederation (CustomerID=2) with reset, filtering=on 其中CustomerFederation,customerId是您的联盟名称和联盟密钥。 基本

如何使用NHibernate在SQL Azure连接中使用联合


例如,我希望联合体使用CustomerID分割数据,并且我希望将所有会话调用定向到基于可配置CustomerID的特定联合体。

因此,如果您知道客户ID,您只需要使用以下命令连接到其他联合体:

use federation CustomerFederation (CustomerID=2) with reset, filtering=on
其中CustomerFederation,customerId是您的联盟名称和联盟密钥。 基本上,只需先执行sql,然后再对另一个联合体执行任何其他操作


抱歉,我的英文版创建了一篇博客文章,详细解释了如何使用NHibernate查询联合会: