Adding
This commit is contained in:
+35
@@ -0,0 +1,35 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user