Skip to content

Instantly share code, notes, and snippets.

@sethdorris
Created April 13, 2021 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sethdorris/a3ae110504e8024ad6221abb78d3b0b5 to your computer and use it in GitHub Desktop.
Save sethdorris/a3ae110504e8024ad6221abb78d3b0b5 to your computer and use it in GitHub Desktop.
public class AppClass {
private User _mainUser;
public bool Login() {
Console.Clear();
return User.Login(_mainUser);
}
}
public class User {
public int Id { get; set; }
public string Username {get;set;}
public string Password {get;set;}
public static Login(User us) {
//ask user for Id
//ask user for pw
int userId = 0;
Int32.TryParse(Console.ReadLine(), out userId);
Console.WriteLine("Enter your pw: ");
var pw = Console.ReadLine();
return us.Id = userId && us.Password = pw;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment