Files
yes.blog/Yes.Infrastructure/DependencyInjection.cs
2025-04-30 09:51:36 +08:00

22 lines
533 B
C#

namespace Yes.Infrastructure
{
public static class DependencyInjection
{
public static IServiceCollection RegisterDataModule(this IServiceCollection services)
{
services.AddBlogDbContext();
return services;
}
public static IServiceCollection AddBlogDbContext(this IServiceCollection services)
{
services.AddScoped<DbContext, BlogDbContext>();
services.AddDbContext<BlogDbContext>();
return services;
}
}
}