Base solution for your next web application
Open Closed

Communicate Entities between tenants #2931


User avatar
0
bseufert created

I'm building an app that has mixed mode tenancy.

A majority of the tenants are "Purchasers", some of the tenants are "Vendors".

The Purchasers will do a bunch of engineering work then send some of the details of the parts they need to one or more Vendors who will quote back with options which will then be reviewed by the original purchasers and issue purchase order to the tenant vendor. I need to communicate between the Purchaser and Vendor tenants the parts rfq, quote, and po.

Is there an example of a pattern within ASP.NET Zero space for this kind of communication between tenants?

Thanks.


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Your usage of multitenancy of ABP in this case is not convinient I think. It is hard to achieve what you are asking with ABP's multitenancy.

    You should not define RFQ, Quote, and PO entities multi tenant, instead you should define them as host entities without a TenantId.

    For example for your RFQ entity, you can add a field CreatorTenantId and you can filter it according to current tenantId for Purchasers. And for Vendors, you need to create a second entity RFQAllowedVendors (you can find a better name here :)) and you can show RFQ to vendors according to this entity data.

    You can implement similar approaches for Quote and PO entities.

    Thanks.

  • User Avatar
    0
    bseufert created

    Ok. looks good... except one question, if I create Host objects, are these host objects available across all tenants (shared and separate database?)

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Yes, you can access them by switching to host context

    CurrentUnitOfWork.SetTenantId(null)