45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
using AutoMapper;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using xAiApi.AI.Interfaces;
|
|
using xAiApi.AI.Mppings;
|
|
using xAiApi.AI.Services;
|
|
|
|
namespace xAiApi.AI.DI
|
|
{
|
|
public static class AIExtensions
|
|
{
|
|
/// <summary>
|
|
/// Register AI Services ...
|
|
/// </summary>
|
|
/// <param name="services"></param>
|
|
public static void AddXAIServices(
|
|
this IServiceCollection services
|
|
)
|
|
{
|
|
//
|
|
// Register AutoMapper Using Mapping Profiles ...
|
|
services.AddAutoMapper(typeof(MappingProfiles).Assembly);
|
|
|
|
//
|
|
// TODO: Remove this ...
|
|
services.AddSingleton<IXAIService, XAIService>();
|
|
|
|
//
|
|
// Since we Used Repositories in this Service,
|
|
// we have to Register it Scoped Lifetime ...
|
|
services.AddScoped<IXAiProvider, XAiProvider>();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Use AI Service Middlewares ...
|
|
/// </summary>
|
|
/// <param name="builder"></param>
|
|
public static void UseXAIServices(this IApplicationBuilder builder)
|
|
{ }
|
|
|
|
//
|
|
#region Private ...
|
|
#endregion
|
|
}
|
|
} |