Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Client(string username, string password, int timeout = 60)
- class Program
- {
- private static int? Timeout => GetFromConfig("Timeout");
- static void Main(string[] args)
- {
- Client client = new Client(Username, Password, Timeout);
- // do things...
- }
- }
- static void Main(string[] args)
- {
- if (Timeout == null)
- {
- Client client = new Client(Username, Password);
- }
- else
- {
- Client client = new Client(Username, Password, Timeout);
- }
- }
- public class Client(string username, string password, int? timeout)
- {
- _timeout = timeout ?? 60;
- }
- public class Client(string username, string password, int? timeout = 60)
- {
- _timeout = timeout ?? 60;
- }
- static void Main(string[] args)
- {
- Client client = new Client(Username, Password, Timeout ?? usedefaultparam);
- // ...
- }
Add Comment
Please, Sign In to add comment