Skip to main content
All docs
V25.1
.NET 8.0+

DevExpress v25.1 Update — Your Feedback Matters

Our What's New in v25.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Add the Scheduler Module (.NET)

  • 3 minutes to read

This article describes how to add the Scheduler module to .NET Windows Forms and ASP.NET Core Blazor applications.

The module implements a calendar component for scheduling appointments and events.

#Step-by-Step Instructions

  1. Add the DevExpress.ExpressApp.Scheduler NuGet package to the MySolution.Module project. See the following topic for more information on how to install DevExpress NuGet packages: Choose Between Offline and Online DevExpress NuGet Feeds.

  2. In the Solution Explorer, go to the MySolution.Module project and open the Module.cs file. Add the Scheduler module to the RequiredModuleTypes collection. Then, add the Event and Resource classes to the AdditionalExportedTypes collection.

    In Entity Framework Core-based applications:

    C#
    //...
    namespace MySolution.Module;
    //...
    public sealed class MySolutionModule : ModuleBase {
        public MySolutionModule() {
            //...
            RequiredModuleTypes.Add(typeof(DevExpress.ExpressApp.Scheduler.SchedulerModuleBase));
            AdditionalExportedTypes.Add(typeof(DevExpress.Persistent.BaseImpl.EF.Event));
            AdditionalExportedTypes.Add(typeof(DevExpress.Persistent.BaseImpl.EF.Resource));
        }
    //...
    }
    

    In XPO-based applications:

    C#
    //...
    namespace MySolution.Module;
    //...
    public sealed class MySolutionModule : ModuleBase {
        public MySolutionModule() {
            //...
            RequiredModuleTypes.Add(typeof(DevExpress.ExpressApp.Scheduler.SchedulerModuleBase));
            AdditionalExportedTypes.Add(typeof(DevExpress.Persistent.BaseImpl.Event));
            AdditionalExportedTypes.Add(typeof(DevExpress.Persistent.BaseImpl.Resource));
        }
    //...
    }
    
  3. Optional. If you use Entity Framework Core, go to the MySolution.Module\BusinessObjects folder, open the MySolutionDbContext.cs file. Then, register the Event and Resource types in the application’s DbContext:

    C#
    namespace MyApplication.Module.BusinessObjects;
    //..
    public class MySolutionDbContext : DbContext {
        // ..
        public DbSet<Event> Events { get; set; }
        public DbSet<Resource> Resources { get; set; }
        }
    

    Note

    Unlike native EF Core, XAF automatically updates database schema when the structure of business objects changes. However, you can use EF Core migrations to update database schema manually. Refer to the following help topic for additional information: Update Database Schema and Migrations in EF Core.

  4. Add the following NuGet packages to platform-specific projects in your application:

    • MySolution.Blazor.Server project: DevExpress.ExpressApp.Scheduler.Blazor
    • MySolution.Win project: DevExpress.ExpressApp.Scheduler.Win
  5. In ASP.NET Core Blazor application, navigate to the MySolution.Blazor.Server\Startup.cs file and call the AddScheduler(IModuleBuilder<IBlazorApplicationBuilder>, Action<SchedulerOptions>) method.

    In Windows Forms application, navigate to the MySolution.Win\Startup.cs file and call the AddScheduler(IModuleBuilder<IWinApplicationBuilder>, Action<SchedulerOptions>) method.

    public class Startup {
    // ...
        public void ConfigureServices(IServiceCollection services) {
            // ...
            services.AddXaf(Configuration, builder => {
                builder.UseApplication<MySolutionBlazorApplication>();
                builder.Modules
                    // ...
                    .AddScheduler();
                // ...
            });
            // ...
        }
    }
    
  6. Build the project and run the application. The Scheduler Event item appears in the navigation control.

    ASP.NET Core Blazor
    Scheduler Module ASP.NET Core Blazor, DevExpress
    Windows Forms
    Scheduler Module Windows Forms, DevExpress

Tip

XAF has a special Notifications module you can use to set notifications for events. For more information about this module, refer to the following topic: How to: Use Notifications with the Scheduler Event.

See Also