You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think everyone is familiar with the nice simple "create a new instance and populate some fields" syntax, it's nice, it's clean, it keeps related code together, and I've never found anyone who doesn't love it... for example:
foo = new Bar()
{
BarID = id,
Value = 123,
Title = "Something"
};
That's great when we're creating foo while setting the values.
But now let's assume that foo already exists, so we can't create it using the above syntax, but we still want to update some fields. It feels like this should be just as easy to do and with similar syntax, but the following isn't possible:
foo {
BarID = id,
Value = 123,
Title = "Something"
};
Instead we have to resort to the old, ugly version:
Hopefully my request is self explanatory: allow us to use that nice clean syntax when updating fields on an existing instance of an object, not just when creating the object.
The text was updated successfully, but these errors were encountered:
I think everyone is familiar with the nice simple "create a new instance and populate some fields" syntax, it's nice, it's clean, it keeps related code together, and I've never found anyone who doesn't love it... for example:
That's great when we're creating foo while setting the values.
But now let's assume that foo already exists, so we can't create it using the above syntax, but we still want to update some fields. It feels like this should be just as easy to do and with similar syntax, but the following isn't possible:
Instead we have to resort to the old, ugly version:
Hopefully my request is self explanatory: allow us to use that nice clean syntax when updating fields on an existing instance of an object, not just when creating the object.
The text was updated successfully, but these errors were encountered: