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