GithubHelp home page GithubHelp logo

replace-if-else's Introduction

This repo is used for a medium article

The purpose is to showcase three different approaches to how controller and actions are designed.

  1. gen1: Service class based controllers. One controller take a dependency on one or more service classes. These controllers are notoriously difficult to deal with once the controllers grow large enough.
  2. gen2: The controller takes a dependency on one or more command classes that act as a command and handler.
  3. gen3: The controller only utilizes a special dispatcher to send commands. It doesn't care about which handlers are invoked to deal with the command.

Generations of controllers

Prerequisites

  • dotnet core 3.1
  • MS-SQL database
  • Redis

Startup instructions

Connection strings

For anyone new or not used to dotnet, connection strings are simply a means to connect to external services.

All connection strings should be set using the dotnet user-secrets set 'key' 'value'

Keys
SQL server: "ConnectionString:default"
Azure queue: "ConnectionString:queue"
Redis cache: "ConnectionString:cache"

Have a look at the appsettings.json in the WebClient project.

This application is configured to require an MS-SQL database and redis cache. You can easily just pull the docker images for this.
The azure queue storage is optional.

Database tables

  1. Go to scripts folder
  2. Run the database.sql script on the database you're using

HTTP Requests

I've created a collection of http requests in http-tests/tests.http.
You can run these directly from JetBrains Rider.

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.