public User GetUser(string userName, string userPwd) { using (TeacherClubContext content = DbContextFactory.CallContext <ReadSqlServerContext>(WriteAndRead.Read)) { return(content.Set <User>().FirstOrDefault(it => it.UserName == userName && it.Password == userPwd)); } }