add login service

This commit is contained in:
yubaolee
2015-04-25 12:31:01 +08:00
parent 7707c6a1e2
commit 370b390c7c
28 changed files with 236 additions and 16 deletions

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OpenAuth.Infrastructure.Repository
{
public class BaseRepository
{
protected OpenAuthDBContext _Context = new OpenAuthDBContext();
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenAuth.Domain.Interface;
using OpenAuth.Domain.Model;
namespace OpenAuth.Infrastructure.Repository
{
public class UserRepository :BaseRepository, IUserRepository
{
public User FindBy(string username)
{
try
{
return _Context.Users.First(e => e.Account == username);
}
catch (Exception)
{
return null;
}
}
}
}