17 lines
558 B
C#
17 lines
558 B
C#
namespace Indotalent.Infrastructure.Database.MySQL;
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
public static class MySQLConfiguration
|
|
{
|
|
public static IServiceCollection AddMySQLContext<TContext>(this IServiceCollection services, string connectionString)
|
|
where TContext : DbContext
|
|
{
|
|
services.AddDbContext<TContext>(options =>
|
|
options.UseMySQL(connectionString, m =>
|
|
m.MigrationsAssembly(typeof(TContext).Assembly.FullName)));
|
|
|
|
return services;
|
|
}
|
|
} |