Giter VIP home page Giter VIP logo

api-example's Introduction

Product.Service (api-example)

API example with part of CQRS model. Application is not using any DB, data are mocked id Domain layer.
Changes in PUT endpoint are not stored. Data are reloaded for every call.
API has 5 hardcoded rows of Product object class.

Endpoints

[GET] /v1/Product/GetAll
[GET] /v1/Product/Get/{id}
[PUT] ​/v1​/Product​/UpdateDescription

Prerequisites

Recomended: Visual Studio 2019 (or Community) or dotnet in command line

Edit

Edit can be done in every text editor (Visual studio recommended). For build is Visual Studio or MSBuild needed.

Execute

With Visual Studio:
Open solution Product.Service.sln (placed in folder \Product.Service\). Service can be run in debug mode directly from visual studio without any changes.
Service will run at http://localhost:29144/ and Visual Studio will automatically start window at Swagger documentation (http://localhost:29144/swagger/index.html)

With command line:
Navigate into folder with Product.Service.Main.csproj (placed in folder \Product.Service\Product.Service.Main\).
Run command dotnet run. API is placed in address http://localhost:5000 (for swagger documentation add /swagger into address)

Tests

With Visual Studio:
Open solution Product.Service.sln (placed in folder \Product.Service\). Open folder Tests in Solution Explorer. Right click on project Product.Service.UnitTests and click Run Tests

With command line:
Navigate into folder with Product.Service.UnitTests.csproj (placed in folder \Product.Service\Product.Service.UnitTests\).
Run command dotnet test. Results will be printed into console.

api-example's People

Contributors

koudel avatar

Watchers

 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.