Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Data.Objects;
- using System.Data.Objects.DataClasses;
- namespace timepaceEF
- {
- public partial class User : timepaceEF.User
- {
- // Create an ObjectContext based on timespacEntities
- private timespaceEntities timespaceContext;
- public User Validate(string email, string password)
- {
- timespaceContext = new timespaceEntities();
- // define a query that returns any User matching the login info
- // throw a login error
- var query = from u in timespaceContext.Users
- where u.Email == email.Trim() && u.Password == password.Trim()
- select u;
- return query.FirstOrDefault();
- }
- }
- }
Add Comment
Please, Sign In to add comment