DEV Community

Discussion on: Fluent APIs Make Developers Love Using Your Libraries

Collapse
 
torvin profile image
Torvin • Edited

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?!
Thread Thread
 
jamesmh profile image
James Hickey

Sure, anyone can try to misuse code if they really want 😜😂