36 lines
1.1 KiB
C#
36 lines
1.1 KiB
C#
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 RefundStatusRepository : BaseRepository, IRefundStatusRepository
|
|
{
|
|
public RefundStatusRepository(AppDbContext context) : base(context) {}
|
|
|
|
public async Task<IReadOnlyCollection<RefundStatus>> ListAsync()
|
|
{
|
|
return await _context.RefundStatuses.ToListAsync();
|
|
}
|
|
|
|
public async Task<RefundStatus> FindByRepoIdAsync(int repoId)
|
|
{
|
|
return await _context.RefundStatuses.Where(refundStatus => refundStatus.RepoId == repoId).FirstOrDefaultAsync();
|
|
}
|
|
|
|
public async Task<RefundStatus> AddAsync(RefundStatus refundStatus)
|
|
{
|
|
var result = await _context.RefundStatuses.AddAsync(refundStatus);
|
|
return result.Entity;
|
|
}
|
|
|
|
public void Update(RefundStatus refundStatus)
|
|
{
|
|
_context.RefundStatuses.Update(refundStatus);
|
|
}
|
|
}
|
|
}
|