Back to Devexpress

IMultiTenancyApplicationBuilder.WithSharedBusinessObjects(Type[]) Method

expressappframework-devexpress-dot-expressapp-dot-multitenancy-dot-xpo-dot-imultitenancyapplicationbuilder-dot-withsharedbusinessobjects-x28-system-dot-type-x29.md

latest3.2 KB
Original Source

IMultiTenancyApplicationBuilder.WithSharedBusinessObjects(Type[]) Method

Registers the specified host business object types as shared data accessible to tenants.

Namespace : DevExpress.ExpressApp.MultiTenancy.Xpo

Assembly : DevExpress.ExpressApp.MultiTenancy.Xpo.v25.2.dll

NuGet Package : DevExpress.ExpressApp.MultiTenancy.XPO

Declaration

csharp
IMultiTenancyApplicationBuilder WithSharedBusinessObjects(
    params Type[] types
)
vb
Function WithSharedBusinessObjects(
    ParamArray types As Type()
) As IMultiTenancyApplicationBuilder

Parameters

NameTypeDescription
typesType[]

The types to share.

|

Returns

TypeDescription
IMultiTenancyApplicationBuilder

The application builder that processed the action.

|

Remarks

In multi-tenant applications, the host database can maintain shared business objects. Call the WithSharedBusinessObjects method to register the specified host business object types as shared data.

csharp
public class Startup { 
    public void ConfigureServices(IServiceCollection services) { 
        // ... 
        builder.AddMultiTenancy() 
            .WithSharedBusinessObjects(typeof(SharedEntityType1), typeof(SharedEntityType2), ...) 
            // ... 
    } 
}

Note

  • Data types associated with shared types must also be registered as shared types. Otherwise, access to associated objects is denied.
  • If an application uses middle-tier security, the shared data types should be registered on the server and client side.

Refer to the following help topic for details on how to access shared business objects from a tenant: Shared Data Support in a Multi-Tenant Application.

See Also

Multi-Tenancy (Data per Tenant)

Shared Data Support in a Multi-Tenant Application

IMultiTenancyApplicationBuilder Interface

IMultiTenancyApplicationBuilder Members

DevExpress.ExpressApp.MultiTenancy.Xpo Namespace