You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if a deconstruct method is auto generated.
Example:
public class Person
{
public string FirstName { get; }
public string LastName { get; }
public string City { get; }
public string State { get; }
public Person(string fname, string lname, string cityName, string stateName)
{
FirstName = fname;
LastName = lname;
City = cityName;
State = stateName;
}
public void Deconstruct(out string fname, out string lname, out string city, out string state)
{
fname = FirstName;
lname = LastName;
city = City;
state = State;
}
}
With:
var person = new Person("aName", "aLastName", "aCity", "aState");
Deconstruction can be used like:
var (first, last, city, state) = person;
Or:
var (first, last, _, _) = person;
The text was updated successfully, but these errors were encountered:
It would be nice if a deconstruct method is auto generated.
Example:
With:
Deconstruction can be used like:
Or:
The text was updated successfully, but these errors were encountered: