コード例 #1
0
 public static void AddUser(Registered user)
 {
     if (Users.Any(x => x.LoginName == user.LoginName))
     {
         throw new LoginException("The user with this login is already registered");
     }
     else
     {
         Users.Add(user);
     }
 }
コード例 #2
0
 public OrderRepository(Registered user)
 {
     if (UsersReg.Users.Any(u => u.LoginName == user.LoginName))
     {
         _user = user;
     }
     else
     {
         UsersReg.AddUser(user);
         _user = user;
     }
 }