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

vllm : Failed to infer device type

android studio kotlin source is null error

gemini cli getting file not defined error