Leandro Fernandes

Results 34 comments of Leandro Fernandes

Any progress in this one? Really miss this feature. My current workaround extension methods are: ```c# public static GenericCollectionAssertions Should(this ReadOnlySpan value) => value.ToArray().Should(); public static StringAssertions Should(this Span value)...

@dennisdoomen good, I will have a try!

F# has this feature long time... it is called [object expressions](https://docs.microsoft.com/dotnet/fsharp/language-reference/object-expressions)

C# recent features are trying to remove boilerplate code (e.g., top-level statements, records, target-typed new expressions, null-coalescing assignment, etc) so this one would be VERY useful too...

In case of someone is looking for such feature, here is [a gist](https://gist.github.com/leandromoh/d81d8ad17f34d10c5b5d0ed5ac13fe87) with my workaround. with follow usage: ```c# var otherPerson = person.With(new { LastName = "Hanselman" }); ```

> @leandromoh this will need an actual spec. Would you be willing to take a stab at writing one? It would need to be an extension to the existing records...

@333fred @HaloFour proposal added in the description of this issue. Feel free to edit it.

@333fred okay, I will try detail it more, but probably it will need some adjusts of you after all.

@ChayimFriedman2 @HaloFour javascript has a [spread operator](https://medium.com/@mwalterspieler_31762/es6-using-the-spread-operator-to-merge-object-d71c62c98056) that makes exactly this. example: ```js var obj1 = { name: "bob", type:"Apple" }; var obj2 = { name: "joe", price: 0.20 };...

@333fred @HaloFour "Detailed design" section updated in the description. Hope it is closer of what is need.