using Microsoft.EntityFrameworkCore; using Portfolio.Shared.Models; using Portfolio.Shared.Services; namespace Portfolio.Api.Services; internal sealed class ProjectRepository(DatabaseContext context) : IProjectRepository { public async Task> GetProjects(CancellationToken ct) { return await context.Projects .Include(p => p.Languages) .OrderByDescending(p => p.OrderIndex) .ToArrayAsync(ct); } public async Task> GetFeaturedProjects(CancellationToken ct) { return await context.Projects .Include(p => p.Languages) .Where(p => p.Featured) .OrderByDescending(p => p.OrderIndex) .ToArrayAsync(ct); } }