Using EF and LINQ has nothing to do with using Identity or SQL Membership. EF is an object relational mapper (ORM) and you'll use it as a replacement for good-old-plain ADO.NET to work with data. LINQ on the other hand is used for querying objects and collections. For example objects generated from your EF. LINQ also provides a handfull of extension methods that you can use to easily manipulate the objects/collections when querying. Having that said, you could still use LINQ and EF to work with ASP.NET Identity.
But if you don't want to use Indentity or Membership then you could something like this:
private string GetUserPassword(string loginName) {
using (DBEntities db = new DBEntities()) {
var user = db.SYSUsers.Where(o => o.LoginName.ToLower().Equals(loginName));
if (user.Any())
return user.FirstOrDefault().PasswordEncryptedText;
else
return string.Empty;
}
}
protected void Button1_Click(object sender, EventArgs e){
string loginName = txtLoginName.Text.Trim();
string password = GetUserPassword(loginName);
if (string.IsNullOrEmpty(password))
Response.Write("The user login or password provided is incorrect.");
else {
if (txtPassword.Text.Equals(password)) {
FormsAuthentication.SetAuthCookie(loginName, false);
Response.Redirect("~/Home.aspx");
}
else {
Response.Write("The password provided is incorrect.");
}
}
}
Note that the code above is just a simple snippet describing the use of EF and LINQ to authenticate users in WebForms. You may need to change some of the code based on your database and controls.