using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using LCU.Shared.Collections.RepoApiLib.Models; using LCU.Shared.Collections.RepoApiLib.Persistence; using Microsoft.EntityFrameworkCore; namespace LCU.Shared.Collections.RepoApiLib.Repositories { public class RepoStatusChangeRepository : BaseRepository, IRepoStatusChangeRepository { public RepoStatusChangeRepository(AppDbContext context) : base(context) { } public async Task> ListAsync() { return await _context.RepoStatusChanges.ToListAsync(); } public async Task> ListForAccountAsync(int repoAccountId) { return await Queryable.Where(_context.RepoStatusChanges, p => p.RepoId == repoAccountId).ToListAsync(); } public async Task AddAsync(RepoStatusChange statusChange) { var result = await _context.RepoStatusChanges.AddAsync(statusChange); return result.Entity; } public async Task FindByIdAsync(int id) { return await _context.RepoStatusChanges.FindAsync(id); } } }