mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 02:29:24 +08:00
routine update
This commit is contained in:
35
OpenAuth.Repository/UserRepository.cs
Normal file
35
OpenAuth.Repository/UserRepository.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenAuth.Domain.Interface;
|
||||
using OpenAuth.Domain.Model;
|
||||
|
||||
namespace OpenAuth.Repository
|
||||
{
|
||||
public class UserRepository :BaseRepository, IUserRepository
|
||||
{
|
||||
public User FindByAccount(string username)
|
||||
{
|
||||
try
|
||||
{
|
||||
return _Context.Users.First(e => e.Account == username);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public User FindById(string id)
|
||||
{
|
||||
try
|
||||
{
|
||||
return _Context.Users.First(e => e.Id == id);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user