File size: 787 Bytes
8fb6238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);
}