
Functional C#
By :

Sometimes, when our code processes a business transaction, it mutates some data several times. In the world of object-oriented programming languages, this is quite a common pattern. We can then separate our code into domain logic and the mutable shell. In domain logic, we simplify the code and write the business logic in a functional way using mathematical functions. As a result, this domain logic will become easy to test. In the mutable shell, we place a mutable expression; we will do this after we finish with the business logic.
Now, let's examine the following code, which contains many side-effects that we are going to refactor, and we can find it in the DomainLogicAndMutatingState.csproj
project:
public class Librarianship { private readonly int _maxEntriesPerFile; public Librarianship( int maxEntriesPerFile) { _maxEntriesPerFile = maxEntriesPerFile; } ...
Change the font size
Change margin width
Change background colour