我已经搜索了很长一段时间,但我还没有找到任何线程来解释如何在代码中准确地找出哪个租户是当前租户。例如,我想更改一些基于租户活动的逻辑,如下所示:
IQueryable<ContentPartRecord> getContentPartDates;
if (Tenat == ExampleTenant)
{
getContentPartDates = GetContentPartDates((int)Id)
.Where(ss => ss.SalesStatus == "Guaranteed")
.OrderBy(x => x.start_date);
}else {
getContentPartDates = GetContentPartDates((int) Id).OrderBy(x => x.start_date);
}到底什么是最好的方法呢?
提前谢谢。
发布于 2013-03-27 06:49:24
在ctor中注入ShellSettings。此对象包含有关外壳的所有数据(来自Settings.txt文件)。租户),在其中执行当前工作单元。
https://stackoverflow.com/questions/15640465
复制相似问题