IOrchardHost.GetShellContext - 创建和设置租户

时间:2015-12-30 11:15:28

标签: orchardcms

我尝试按代码创建和设置租户。 当我写这段代码时:

_tenantService.CreateTenant(tenantSettings);
var shellContext = _orchardHost.GetShellContext(newTenantShellSettings);

shellContext为null。然后我将代码更改为:

_tenantService.CreateTenant(tenantSettings);
_orchardHost.EndRequest();
_orchardHost.BeginRequest();
var shellContext = _orchardHost.GetShellContext(newTenantShellSettings);

这次,shellContext有效,但它使登录状态无效(我的意思是退出我)。

这有什么不对吗?

0 个答案:

没有答案
相关问题