Exemplo n.º 1
0
 public static User VerifyToken(string token)
 {
     using (TexxtyDBEntities entities = new TexxtyDBEntities())
     {
         return(entities.Users.FirstOrDefault(user => user.Token == token));
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 3
0
 public TopicRepository()
 {
     this.context = new TexxtyDBEntities();
 }
Exemplo n.º 4
0
 public SearchUtility()
 {
     context        = new TexxtyDBEntities();
     blogRepository = new BlogRepository();
     postRepository = new PostRepository();
 }
Exemplo n.º 5
0
 public UserRepository()
 {
     this.context = new TexxtyDBEntities();
 }