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()); } }
public bool IsValid(string name, string password) { using (var db = new OurContectDb()) { return(db.UserAccounts.Any(u => u.Username == name && u.Password == password)); } }