Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.ObjectModel;
- using System.Linq;
- namespace WindowsFormsApplication1
- {
- public class User
- {
- public string Username { get; set; }
- public string Password { get; set; }
- public static Collection<User> getListOfUsers()
- {
- return new Collection<User>
- {
- new User{Username = "tommy", Password = "secret"},
- new User{Username = "brendan", Password = "secret"},
- new User{Username = "jack", Password = "secret"},
- };
- }
- }
- public static class UserHelper
- {
- public static bool validateLogin(this Collection<User> users, string username, string password)
- {
- return users.FirstOrDefault(x => x.Username == username).Password == password;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement