What is it called when you set properties on object initialization?var customer = new Customer() {RequestID = request.ID, AddressID = 5};Is it considered good practice?
What is it called when you set properties on object initialization?
c#;naming
It's called object initializer or object initialization expressions, in C# at least.  Its implementation was necessary for LinQ, to dynamically create anonymous types in a convenient manner.Whether it's a good practice or not depends on how you use it. Read Jon Skeet's thoughts about them on stackoverflow to gain some more insight. Jimmy Hoffa also wrote an excellent answer on codereview. He proposes to base the decision for or against object initializers on the question: Is the object safely usable if the properties are null? If so, then object initializers provide a very convenient and readable way to create an object.