c# expression body for working with multiple item.




Many times you need to work with constructor assignment of multiple value for body expression
The following code show how we can do it.

public class Person
{
    public string Name { get; }
    public int Age { get; }

    public Person(string name, int age) => (Name, Age) = (name, age);
}

Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm