app / src /ClipForge.Infrastructure /Repositories /VideoIdeaRepository.cs
Vanderson da Silva Quintino
Initial deploy: ClipForge video generator
8fb6238
Raw History Blame Contribute Delete
787 Bytes
using ClipForge.Core.Entities;
using ClipForge.Core.Interfaces;
using ClipForge.Infrastructure.Data;
using Microsoft.EntityFrameworkCore;
namespace ClipForge.Infrastructure.Repositories;
public class VideoIdeaRepository : BaseRepository<VideoIdea>, IVideoIdeaRepository
{
public VideoIdeaRepository(AppDbContext context) : base(context) { }
public async Task<IReadOnlyList<VideoIdea>> GetByStatusAsync(string status, CancellationToken ct = default)
=> await _dbSet.Where(i => i.Status == status).OrderByDescending(i => i.CreatedAt).ToListAsync(ct);
public async Task<IReadOnlyList<VideoIdea>> GetByNicheAsync(string niche, CancellationToken ct = default)
=> await _dbSet.Where(i => i.Niche == niche).OrderByDescending(i => i.CreatedAt).ToListAsync(ct);
}