Base solution for your next web application
Open Closed

SingleTon per tenant #1275


User avatar
0
justin created

I went through lot of the documentation but did not see any examples for Singleton object By tenant not host. A Object that has instance per tenant. Is there a way to do that in ABP?


2 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    What do you mean by "singleton object by tenant"? Do you mean a singleton objects in dependency injection or a database entity. Can you provide details and an example if possible.

  • User Avatar
    0
    justin created

    this concept is discussed here <a class="postlink" href="http://benfoster.io/blog/asp-net-core-dependency-injection-multi-tenant">http://benfoster.io/blog/asp-net-core-d ... lti-tenant</a>

    "f a singleton is created once per application, you can probably guess that a tenant-singleton is created once per tenant.

    So when might you need this scope? Think of any object that is expensive to create or needs to maintain state yet should be isolated for each tenant."