MultiTenancy Orchard - How to know which tenant is requesting from

I've searched for quite a while, but I haven't found a thread explaining exactly how to figure out which Tenant is current in the code. For example, I want to change some logic based on what is active like so:

            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);
            }

      

What's the best way to do this?

Thanks in advance.

+3


source to share


1 answer


Input ShellSettings

to ctor. This object contains all the data (from the Settings.txt file) about the shell (i.e. the Tenant) in which the current unit of work is running.



+4


source







All Articles