Testing more garbage encryption
This commit is contained in:
8
SVSim.Database/Repositories/Viewer/IViewerRepository.cs
Normal file
8
SVSim.Database/Repositories/Viewer/IViewerRepository.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using SVSim.Database.Enums;
|
||||
|
||||
namespace SVSim.Database.Repositories.Viewer;
|
||||
|
||||
public interface IViewerRepository
|
||||
{
|
||||
Task<Models.Viewer?> GetViewerBySocialConnection(SocialAccountType accountType, ulong socialId);
|
||||
}
|
||||
24
SVSim.Database/Repositories/Viewer/ViewerRepository.cs
Normal file
24
SVSim.Database/Repositories/Viewer/ViewerRepository.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SVSim.Database.Enums;
|
||||
using SVSim.Database.Models;
|
||||
|
||||
namespace SVSim.Database.Repositories.Viewer;
|
||||
|
||||
public class ViewerRepository : IViewerRepository
|
||||
{
|
||||
protected readonly SVSimDbContext _dbContext;
|
||||
|
||||
public ViewerRepository(SVSimDbContext dbContext)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
}
|
||||
|
||||
public async Task<Models.Viewer?> GetViewerBySocialConnection(SocialAccountType accountType, ulong socialId)
|
||||
{
|
||||
return _dbContext.Set<SocialAccountConnection>()
|
||||
.AsNoTracking()
|
||||
.Include(sac => sac.Viewer)
|
||||
.FirstOrDefault(sac => sac.AccountType == accountType && sac.AccountId == socialId)
|
||||
?.Viewer;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user