Git Product home page Git Product logo

altnetrop's Introduction

Railway-Oriented Programming in C#

This is a simple project intended to show a simple implementation of Railway-Oriented programming using C#

It's based on the amazing work done by Scott Wlaschin at F# For Fun and Profit I can't recommend this site highly enough!

How to run

You need to have .NET Core installed. This was done using the .NET Core 2.0 Preview 2 with Visual Studio Code to edit, but there's no reason why it shouldn't work on other versions. Given it's just plain C# with no tricks, it should work fine in visual studio as well. Although it'd be pretty easy to remove I've used a few C# 6 features (nameof) so you'll need VS 2015 or later to get it to build.

There are four versions of the code:

  1. The optimistic "Happy Path"
  2. The unfortunate "Sad Path"
  3. The safer but clunky "Safe Path"
  4. The railway-oriented "Awesome Path"

If you look at Program.cs you can just execute using different IOC contexts to run the different versions. eg. Handle<V4.V4Registry>(evt); will run the V4 ROP version.

To build:

  • Change to the Demo directory
  • Run command dotnet build

To execute:

  • Change to the Demo directory
  • Run command dotnet run

To run the tests:

  • Change to the Tests directory
  • Run command dotnet test

Note that these are all set up as build tasks, so in VS Code you can just use Run Task... or do F5 to run the code

altnetrop's People

Contributors

mdenny-visaglobal avatar habaneroofdoom avatar

Watchers

James Cloos avatar George Homorozeanu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.