Skip to main content
All docs
V25.1
  • .NET 8.0+
    • The page you are viewing does not exist in the .NET Framework 4.6.2+ platform documentation. This link will take you to the parent topic of the current section.

    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.1.dll

    NuGet Package: DevExpress.ExpressApp.MultiTenancy.XPO

    Declaration

    IMultiTenancyApplicationBuilder WithSharedBusinessObjects(
        params Type[] types
    )

    Parameters

    Name Type Description
    types Type[]

    The types to share.

    Returns

    Type Description
    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.

    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