Adding
This commit is contained in:
+38
@@ -0,0 +1,38 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using LCU.API.Internal.RepoApi.Repos.Models;
|
||||
using LCU.API.Internal.RepoApi.Repos.Persistence;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace LCU.API.Internal.RepoApi.Repos.Repositories
|
||||
{
|
||||
public class RepoStatusChangeRepository : BaseRepository, IRepoStatusChangeRepository
|
||||
{
|
||||
public RepoStatusChangeRepository(AppDbContext context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RepoStatusChange>> ListAsync()
|
||||
{
|
||||
return await _context.RepoStatusChanges.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RepoStatusChange>> ListForAccountAsync(int repoAccountId)
|
||||
{
|
||||
return await Queryable.Where<RepoStatusChange>(_context.RepoStatusChanges, p => p.RepoId == repoAccountId).ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<RepoStatusChange> AddAsync(RepoStatusChange statusChange)
|
||||
{
|
||||
var result = await _context.RepoStatusChanges.AddAsync(statusChange);
|
||||
return result.Entity;
|
||||
}
|
||||
|
||||
public async Task<RepoStatusChange> FindByIdAsync(int id)
|
||||
{
|
||||
return await _context.RepoStatusChanges.FindAsync(id);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user