Major refactor of AdminController and related services to support full CRUD for candidate resume, projects, hobbies, skills, academics, experiences, certifications, and contact info, all using access token claims for candidate identity. Introduced AdminService and expanded IResumeRepository for granular entity management. Updated DTOs for upsert operations and date support. Improved API versioning (Asp.Versioning.Mvc), Swagger integration, and middleware setup. Added unit test project. Enhanced error handling, documentation, and mapping.
29 lines
1.0 KiB
C#
29 lines
1.0 KiB
C#
using PortBlog.API.Repositories;
|
|
using PortBlog.API.Repositories.Contracts;
|
|
using PortBlog.API.Services;
|
|
using PortBlog.API.Services.Contracts;
|
|
|
|
namespace PortBlog.API.Extensions
|
|
{
|
|
public static class ServiceExtensions
|
|
{
|
|
public static IServiceCollection AddRepositories(this IServiceCollection services)
|
|
{
|
|
services.AddScoped<ICandidateRepository, CandidateRepository>();
|
|
services.AddScoped<IResumeRepository, ResumeRepository>();
|
|
services.AddScoped<IMailRepository, MailRepository>();
|
|
services.AddScoped<IBlogRepository, BlogRepository>();
|
|
return services;
|
|
}
|
|
|
|
public static IServiceCollection AddServices(this IServiceCollection services)
|
|
{
|
|
services.AddTransient<IMailService, MailService>();
|
|
services.AddTransient<IAuthService, AuthService>();
|
|
services.AddTransient<ITemplateService, TemplateService>();
|
|
services.AddScoped<IAdminService, AdminService>();
|
|
return services;
|
|
}
|
|
}
|
|
}
|