Example #1
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);
            }
        }
Example #2
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);
            }
        }
 public CityInfoesController(WebAPIDBContext context)
 {
     _context = context;
 }
Example #4
0
 public SubjectsController(WebAPIDBContext context)
 {
     _context = context;
 }
Example #5
0
 public UserService()
 {
     _entities = new WebAPIDBContext();
 }
 public StudentsController(WebAPIDBContext context)
 {
     _context = context;
 }