DI and Business Rules #1730
-
We have multi tenant application in which tenants are able to define their on business rules using wizards.However we require the tenant id to retrieve the appropriate business rules for a specific tenant for a particular BO using the approach suggested by @rockfordlhotka in issue #847 in the old forum.The tenant object is injected in data portal's create or fetch,however these methods are run after the AddBusinessRule override has run on first initialization and the tenant is null is this instance.We tried to use an anti-pattern of using the GetService method of the ServiceProvider. However the Csla.ApplicationContext.DefaultServiceProvider is write only and Csla .NET does not support constructor injection. How do we get the tenant id in this instance? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Normally you'd put the tenant id as a claim in the Or put the RuleSet name in the |
Beta Was this translation helpful? Give feedback.
Normally you'd put the tenant id as a claim in the
ClaimsIdentity
for the user, because each user might sign in under a different tenant.Or put the RuleSet name in the
ClaimsIdentity
- kind of the same thing, as you want the rules engine to use the correct rule set for the user's tenant.