6423713305
- Register IAdminUserRepository in DependencyInjection - Add connection string to appsettings.json - Make database migrations non-blocking (allow app to start even if DB unavailable) - Remove UseAuthentication() middleware (using client-side JWT auth instead) - App now runs successfully on https://localhost:5002 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
21 lines
726 B
C#
21 lines
726 B
C#
namespace TaxBaik.Infrastructure;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using TaxBaik.Domain.Interfaces;
|
|
using TaxBaik.Infrastructure.Data;
|
|
using TaxBaik.Infrastructure.Repositories;
|
|
|
|
public static class DependencyInjection
|
|
{
|
|
public static IServiceCollection AddInfrastructure(this IServiceCollection services)
|
|
{
|
|
services.AddSingleton<IDbConnectionFactory, DbConnectionFactory>();
|
|
services.AddScoped<IAdminUserRepository, AdminUserRepository>();
|
|
services.AddScoped<ICategoryRepository, CategoryRepository>();
|
|
services.AddScoped<IBlogPostRepository, BlogPostRepository>();
|
|
services.AddScoped<IInquiryRepository, InquiryRepository>();
|
|
|
|
return services;
|
|
}
|
|
}
|