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.

    OfficeApplicationBuilderExtensions.AddOffice(IModuleBuilder<IBlazorApplicationBuilder>, Action<OfficeOptions>) Method

    Adds the Office Module to your application.

    Namespace: DevExpress.ExpressApp.Blazor.ApplicationBuilder

    Assembly: DevExpress.ExpressApp.Office.Blazor.v25.1.dll

    NuGet Package: DevExpress.ExpressApp.Office.Blazor

    Declaration

    public static IModuleBuilder<IBlazorApplicationBuilder> AddOffice(
        this IModuleBuilder<IBlazorApplicationBuilder> builder,
        Action<OfficeOptions> configureOptions = null
    )

    Parameters

    Name Type Description
    builder IModuleBuilder<IBlazorApplicationBuilder>

    Allows you to register and configure Modules in your application and chain further Module registrations.

    Optional Parameters

    Name Type Default Description
    configureOptions Action<OfficeOptions> null

    Contains options that you can use to configure the Office Module.

    Returns

    Type Description
    IModuleBuilder<IBlazorApplicationBuilder>

    Allows you to register and configure Modules in your application, and chain further Module registrations.

    Remarks

    The following example demonstrates how to use this method:

    using DevExpress.ExpressApp.ApplicationBuilder;
    using DevExpress.ExpressApp.Blazor.ApplicationBuilder;
    using DevExpress.Persistent.BaseImpl.EF;
    // ...
    public class Startup {
       // ...
        public void ConfigureServices(IServiceCollection services) {
            // ...
            services.AddXaf(Configuration, builder => {
                builder.UseApplication<YourSolutionNameBlazorApplication>();
                builder.Modules
                    // ...
                    .AddOffice(options => {
                        options.RichTextMailMergeDataType = typeof(RichTextMailMergeData);
                    })
                // ...
            });
            // ...
        }
    }
    

    Important

    If you use Entity Framework Core, register the DevExpress.Persistent.BaseImpl.EF.RichTextMailMergeData type in the DbContext (see Ways to Add a Business Class - Import Classes from a Business Class Library or Module). If you use the Application Designer, you must register the type before you open the designer window.

    See Also