All Posts assertfail

View the Blog on GitHub wallymathieu

Using readonly objects in c#

18 Oct 2013

One thing I like about f# is the ability to use readonly objects in a way that does not require a lot of code. I’ve done a small lib inspired by this ability of f#: with

The syntax is a bit special since I assume that the properties have a private set.

<blockquote class="tr_bq">

myobject.With(m => m.Property1 == 3 && m.Property2 == "3")



  • c#
  • Comments or errors? Fork post and do a pull request on github