I would agree 100%. The class I used in the article actually wouldn't work in the snippet you made 😉
The second line of your code snippet would throw an exception since the only available method would be Result, which I highlighted in the article.
Result
It should actually do what you want (immutable) 👍
You are right, sorry, my bad! Try this:
var x = MyFluentClass.WithValue(5); var y = x.Subtract(5); Console.WriteLine(x.Add(1).Result()); // correctly returns 6 Console.WriteLine(y.Result()); // 6 again?!
Sure, anyone can try to misuse code if they really want 😜😂
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I would agree 100%. The class I used in the article actually wouldn't work in the snippet you made 😉
The second line of your code snippet would throw an exception since the only available method would be
Result
, which I highlighted in the article.It should actually do what you want (immutable) 👍
You are right, sorry, my bad! Try this:
Sure, anyone can try to misuse code if they really want 😜😂