buff
buff

Reputation: 331

Orchard ShellSettingsManager always returns the second Tenant settings

I'm running a multi tenant Orchard Web app . When running the first time (with multi tenant already set up) when requesting ~/ I'm calling a service to get the current Shell settings.

and its returning me the second Tenant ShellSettings with BaseUrl (~/Tenant1) :

_ShellManager.LoadSettings().FirstOrDefault()

is this a bug or am I missing something?

Upvotes: 0

Views: 132

Answers (1)

Hazza
Hazza

Reputation: 6591

The correct way to access the shell settings for the current tenant is by injecting shell settings into your constructor like so:

private readonly ShellSettings _shellSettings;

public MyClass(ShellSettings shellSettings) {
  _shellSettings = _shellSettings;
}

Upvotes: 1

Related Questions