Exemple #1
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
     }
     base.Dispose(disposing);
 }
Exemple #2
0
        public static User GetUserByCredentials(string login, string password)
        {
            using (WebAPIDBContext entities = new WebAPIDBContext())
            {
                var result = entities.Users.FirstOrDefault(user =>
                                                           user.Login.Equals(login, StringComparison.OrdinalIgnoreCase) &&
                                                           user.Password == password);

                entities.Dispose();
                return(result);
            }
        }
Exemple #3
0
        public static bool Login(string login, string password)
        {
            using (WebAPIDBContext entities = new WebAPIDBContext())
            {
                var result = entities.Users.Any(user =>
                                                user.Login.Equals(login, StringComparison.OrdinalIgnoreCase) &&
                                                user.Password == password);

                entities.Dispose();
                return(result);
            }
        }
Exemple #4
0
 public void Dispose()
 {
     _entities.Dispose();
 }