Skip to content

Instantly share code, notes, and snippets.

@Mirch
Last active December 4, 2018 17:26
Show Gist options
  • Save Mirch/e9ba929111ed39e4df4f6fb96be84eba to your computer and use it in GitHub Desktop.
Save Mirch/e9ba929111ed39e4df4f6fb96be84eba to your computer and use it in GitHub Desktop.
public class Destination
{
public string Uri { get; set; }
public bool RequiresAuthentication { get; set; }
static HttpClient client = new HttpClient();
public Destination(string uri, bool requiresAuthentication)
{
Uri = path;
RequiresAuthentication = requiresAuthentication;
}
public Destination(string uri)
:this(uri, false)
{
}
private Destination()
{
Uri = "/";
RequiresAuthentication = false;
}
}
@MichalMaminski
Copy link

What do you think about to refactor this code in the following manner:

  • remove second constructor, this with empty body
  • in the first constructor add default value to the second argument

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment