Allow using previous properties in declaring future properties on an object initializer #2776
Replies: 5 comments
-
A more real life example: var person = new Person
{
Email = "[email protected]",
EmailTypeID = 1,
EmailTypeName = LookupEmailTypeName(EmailTypeID),
} |
Beta Was this translation helpful? Give feedback.
-
this will break existing code if containing class has EmailTypeID property or local |
Beta Was this translation helpful? Give feedback.
-
I'm 99% sure this has already been raised in another issue, but cannot for the life of me find that other issue. |
Beta Was this translation helpful? Give feedback.
-
I had a similar idea today for a slightly more complex scenario: new Table
{
Columns =
{
new Column { Name = "Id" } idColumn // 😈
},
PrimaryKey = new PrimaryKey
{
Columns = { idColumn }
}
}; |
Beta Was this translation helpful? Give feedback.
-
@bricelam |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
For instance:
Beta Was this translation helpful? Give feedback.
All reactions