why validate return null although i have it
- public Registration ValidateUser(string userName, string passWord)
- {
- try
- {
- using (var _context = new DatabaseContext())
- {
- var validate = (from user in _context.Registration
- where user.Username == userName && user.Password == passWord
- select user).SingleOrDefault();
- var users=_context.Registration;
- return validate;
- }
- }
- catch (Exception)
- {
- throw;
- }
- }
- public DbSet<Registration> Registration { get; set; }
and in db i have Registration table with records