CODEX_ADK/BACKEND/Codex.Dal/ServiceCollectionExtensions.cs
Svrnty 229a0698a3 Initial commit: CODEX_ADK monorepo
Multi-agent AI laboratory with ASP.NET Core 8.0 backend and Flutter frontend.
Implements CQRS architecture, OpenAPI contract-first API design.

BACKEND: Agent management, conversations, executions with PostgreSQL + Ollama
FRONTEND: Cross-platform UI with strict typing and Result-based error handling

Co-Authored-By: Jean-Philippe Brule <jp@svrnty.io>
2025-10-26 23:12:32 -04:00

32 lines
1.1 KiB
C#

using Codex.Dal.QueryProviders;
using Microsoft.Extensions.DependencyInjection;
using OpenHarbor.CQRS;
namespace Codex.Dal;
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddQueryableProviderOverride<T, TService>(this IServiceCollection services)
where TService : class, IQueryableProviderOverride<T>
{
return services.AddTransient<IQueryableProviderOverride<T>, TService>();
}
/// <summary>
/// Registers all dynamic queries (paginated queries)
/// </summary>
public static IServiceCollection AddDynamicQueries(this IServiceCollection services)
{
// Agent list query
services.AddQueryableProviderOverride<ListAgentsQueryItem, ListAgentsQueryableProvider>();
// Agent execution list query
services.AddQueryableProviderOverride<ListAgentExecutionsQueryItem, ListAgentExecutionsQueryableProvider>();
// Conversation list query
services.AddQueryableProviderOverride<ListConversationsQueryItem, ListConversationsQueryableProvider>();
return services;
}
}