27 lines
704 B
C#
27 lines
704 B
C#
|
using Newsbot.Collector.Domain.Entities;
|
||
|
using Newsbot.Collector.Domain.Interfaces;
|
||
|
|
||
|
namespace Newsbot.Collector.Database.Repositories;
|
||
|
|
||
|
public class UserSourceSubscriptionTable : IUserSourceSubscription
|
||
|
{
|
||
|
private DatabaseContext _context;
|
||
|
|
||
|
public UserSourceSubscriptionTable(string connectionString)
|
||
|
{
|
||
|
_context = new DatabaseContext(connectionString);
|
||
|
}
|
||
|
|
||
|
public UserSourceSubscriptionTable(DatabaseContext context)
|
||
|
{
|
||
|
_context = context;
|
||
|
}
|
||
|
|
||
|
public List<UserSourceSubscriptionEntity> ListUserSubscriptions(Guid userId)
|
||
|
{
|
||
|
var results =_context.UserSourceSubscription.Where(i => i.UserId.Equals(userId)).ToList();
|
||
|
return results;
|
||
|
}
|
||
|
}
|
||
|
|