예제 #1
0
 public int GetId(string name, string password)
 {
     using (var db = new OurContectDb())
     {
         return(db.UserAccounts.Where(u => u.Username == name && u.Password == password).Select(p => p.Id).First());
     }
 }
예제 #2
0
 public bool IsValid(string name, string password)
 {
     using (var db = new OurContectDb())
     {
         return(db.UserAccounts.Any(u => u.Username == name && u.Password == password));
     }
 }