SharedLogic.NET

SharedLogic.NET is a library that radically reduces the complexity of server-side verification of meta-gameplay or gameplay in turn-based games.
Instead of inventing complex schemes for validating player actions, you simply run the exact same code on both the Unity client and the .NET backend.

All client actions are applied instantly on the client (essentially a form of Client-Side Prediction) and then sent to the server, where they are executed against the same player state.
After that, the server verifies that the execution result is identical to the client’s result, and only then applies the state changes to the database.

A detailed explanation can be found here:
https://lezhnev.de/sharedlogic-reusable-game-code-across-unity-client-and-net-backend-to-ease-your-work/

You can also view or use the source code here:
https://github.com/NikolayLezhnev/sharedlogic