Skip to content

Core Notification Legacy Connector Module

The main idea behind the CoreNotificationsLegacyConnectorModule is that, when you create your own service, you can retrieve the LegacyInternalMessages from Core Legacy Database.

The Core Notification Legacy Connector Module provides a way to integrate other services with Core LTS version.

The CoreNotificationsLegacyConnectorModule delivers materialized representations of LegacyInternalMessages, LegacyInternalMessageUsers and LegacyInternalMessagePositions.

How to use it

We need to depend on the CoreNotificationsLegacyConnectorModule and also configure the DbContext where we want the Legacy Internal Message entity added to:

C#
public  class  MyServiceApplicationModule : SuiteAspNetApplicationModule
{
 public  override  void  SetupModule(IModuleBuilder  builder)
 {
  builder.DependsOn<CoreNotificationsLegacyConnectorModule, CoreNotificationsLegacyConnectorModuleOptions>(opts =>
    {
        opts.SetDbContext<CoreNotificationLegacyConnectorDbContext>();
    });
 }
}

Then we need to add the connection string of the Core Legacy Database on the appsettings.json of our Application:

JSON
1
2
3
 "ConnectionStrings": {
        "CoreLegacyConnection": "Server=host,port;Initial Catalog=CORE;Integrated Security=False;User Id=user;Password=password"
    }

Finally we can create the IRepository as follows:

C#
  IReadOnlyRepository<long, LegacyInternalMessages> coreInternalMessagesRepository;

These IReadOnlyRepositories allow us to query data from Core Legacy Database.