Equivalence of “With…End With” in C#? [duplicate]

It’s not equivalent, but would this syntax work for you?

Animal a = new Animal()
{
    SpeciesName = "Lion",
    IsHairy = true,
    NumberOfLegs = 4
};

Leave a Comment