27 lines
792 B
C#
27 lines
792 B
C#
using IdentityServer.Domain.Data.DbContexts;
|
|
using IdentityServer.Domain.Entities;
|
|
using IdentityServer.Domain.Repositories;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace IdentityServer.Domain.Data.Repositories
|
|
{
|
|
class IdentityRepository : IIdentityRepository
|
|
{
|
|
private readonly IdentityDbContext _dbContext;
|
|
|
|
public IdentityRepository(IdentityDbContext dbContext)
|
|
{
|
|
_dbContext = dbContext;
|
|
}
|
|
|
|
public Task<AppUser> GetAppUser(string userName, string password)
|
|
{
|
|
return _dbContext.Users
|
|
.Include(z => z.Status)
|
|
.Include(z => z.Claims)
|
|
.FirstOrDefaultAsync(z => z.UserName == userName && z.Password == password);
|
|
}
|
|
}
|
|
}
|