mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-05-15 20:49:35 +08:00
31 lines
767 B
C#
31 lines
767 B
C#
![]() |
using OpenAuth.Domain.Interface;
|
|||
|
|
|||
|
namespace OpenAuth.Domain.Service
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// Ȩ<><EFBFBD><DEB7>乤<EFBFBD><E4B9A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>ǿ<EFBFBD><C7BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˺Ŵ<CBBA><C5B4><EFBFBD>
|
|||
|
/// </summary>
|
|||
|
public class AuthoriseFactory
|
|||
|
{
|
|||
|
private IUnitWork _unitWork;
|
|||
|
|
|||
|
public AuthoriseFactory(IUnitWork unitWork)
|
|||
|
{
|
|||
|
_unitWork = unitWork;
|
|||
|
}
|
|||
|
public AuthoriseService Create(string loginuser)
|
|||
|
{
|
|||
|
if (loginuser == "System")
|
|||
|
{
|
|||
|
return new SystemAuthService(_unitWork);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return new AuthoriseService(_unitWork)
|
|||
|
{
|
|||
|
User = _unitWork.FindSingle<User>(u =>u.Account == loginuser)
|
|||
|
};
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|