OpenAuth.Net/OpenAuth.Repository/UserRepository.cs

36 lines
740 B
C#
Raw Normal View History

2015-04-25 12:31:01 +08:00
using System;
using System.Linq;
using OpenAuth.Domain.Interface;
using OpenAuth.Domain.Model;
2015-05-24 23:23:26 +08:00
namespace OpenAuth.Repository
2015-04-25 12:31:01 +08:00
{
public class UserRepository :BaseRepository, IUserRepository
{
public User FindByAccount(string username)
2015-04-25 12:31:01 +08:00
{
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;
}
}
2015-04-25 12:31:01 +08:00
}
}