Initial commit carried over from private repo. This is V2.
This commit is contained in:
18
code/MessengerApi.Db/Repositories/UserRepository.cs
Normal file
18
code/MessengerApi.Db/Repositories/UserRepository.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using MessengerApi.Db.Contracts.Repositories;
|
||||
using MessengerApi.Db.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace MessengerApi.Db.Repositories
|
||||
{
|
||||
public class UserRepository : Repository<User>, IUserRepository
|
||||
{
|
||||
public UserRepository(DbSet<User> db) : base(db)
|
||||
{
|
||||
}
|
||||
|
||||
public User SingleByApiKeyAndEnabled(Guid id, bool enabled)
|
||||
{
|
||||
return this.db.Single(x => x.ApiKey == id && x.IsEnabled == enabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user