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>
33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using OpenHarbor.CQRS.DynamicQuery.Abstractions;
|
|
|
|
namespace Codex.Dal.QueryProviders;
|
|
|
|
/// <summary>
|
|
/// Queryable provider for listing conversations with filtering, sorting, and pagination
|
|
/// </summary>
|
|
public class ListConversationsQueryableProvider(CodexDbContext dbContext)
|
|
: IQueryableProviderOverride<ListConversationsQueryItem>
|
|
{
|
|
public Task<IQueryable<ListConversationsQueryItem>> GetQueryableAsync(
|
|
object query,
|
|
CancellationToken cancellationToken = default)
|
|
{
|
|
var result = dbContext.Conversations
|
|
.AsNoTracking()
|
|
.Select(c => new ListConversationsQueryItem
|
|
{
|
|
Id = c.Id,
|
|
Title = c.Title,
|
|
Summary = c.Summary,
|
|
IsActive = c.IsActive,
|
|
CreatedAt = c.StartedAt,
|
|
LastMessageAt = c.LastMessageAt,
|
|
MessageCount = c.Messages.Count,
|
|
ExecutionCount = c.Executions.Count
|
|
});
|
|
|
|
return Task.FromResult(result);
|
|
}
|
|
}
|