My web app is in asp.net MVC with mysql database.
Here is the hangfire configuration:
public void ConfigureServices(IServiceCollection services)
{
services.AddHangfire(configuration => {
configuration.UseStorage(
new MySqlStorage(
"server=127.0.0.1;uid=root;pwd=root;database={0};Allow User Variables=True",
new MySqlStorageOptions
{
TablesPrefix = "Hangfire"
}
)
);
};
}
I’m getting excepton table
hangfireSet
not found.
In database table is created as hangfireset
I can solve this issue by changing table names to lower case in OnModelCreating as shown below:
protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<TableName>().ToTable("tablename");
}
How can I access hangfire model classes in OnModelCreating so that I can change table names to lower case.