コード例 #1
0
 public RequestUserSign SignUser(string Login, string Password)
 {
     using (Context context = new Context())
     {
         UserSign DataBaseUser = context.Users.FirstOrDefault(x => x.Login == Login && x.Password == Password);
         if (DataBaseUser != null)
         {
             RequestUserSign request = new RequestUserSign();
             request.Login    = Login;
             request.Password = Password;
             return(request);
         }
         return(null);
     }
 }
コード例 #2
0
        public void RegisterUser(string Login, string Password)
        {
            using (Context context = new Context())
            {
                UserSign DataBaseUser = context.Users.FirstOrDefault(x => x.Login == Login && x.Password == Password);
                if (DataBaseUser == null)
                {
                    UserSign RegUser = new UserSign();
                    RegUser.Login    = Login;
                    RegUser.Password = Password;

                    context.Users.Add(RegUser);
                    context.SaveChanges();
                }
            }
        }