Base solution for your next web application
Open Closed

MS SQL Server for main DB and MySQL for Hangfire #6248


User avatar
0
rafalpiotrowski created

Hi, Is this possible to use MS SQL Server for main "Default" db and another db like MySQL for Hangfire?


2 Answer(s)
  • User Avatar
    0
    rafalpiotrowski created

    Yes we can!

    need to installnuget package Hangfire.MySqlStorage in AspNetZeroProject.Web.Core

    and in AspNetZeroProject.Web.Host Startup.cs file add this

                services.AddHangfire(config =>
                {
                    new MySqlStorage(_appConfiguration.GetConnectionString("Hangfire_MySQL"));
                });
                JobStorage.Current = new MySqlStorage(_appConfiguration.GetConnectionString("Hangfire_MySQL"));
    
  • User Avatar
    0
    rafalpiotrowski created

    its closed