示例#1
0
 public static User VerifyToken(string token)
 {
     using (TexxtyDBEntities entities = new TexxtyDBEntities())
     {
         return(entities.Users.FirstOrDefault(user => user.Token == token));
     }
 }
示例#2
0
 public static string AuthenticateUser(string username, string password, out int userID)
 {
     using (TexxtyDBEntities entities = new TexxtyDBEntities())
     {
         var entity = entities.Users.FirstOrDefault(user => user.Username == username && user.Password == password);
         if (entity != null)
         {
             userID = entity.UserID;
             return(entity.Token);
         }
         else
         {
             userID = 0;
             return(null);
         }
     }
 }
示例#3
0
 public TopicRepository()
 {
     this.context = new TexxtyDBEntities();
 }
示例#4
0
 public SearchUtility()
 {
     context        = new TexxtyDBEntities();
     blogRepository = new BlogRepository();
     postRepository = new PostRepository();
 }
示例#5
0
 public UserRepository()
 {
     this.context = new TexxtyDBEntities();
 }