/News-REST-Service

Xamarin Android client and REST service based on ASP.NET Core Web API, Entity Framework Core and SQL Server that holds news.

Primary LanguageC#MIT LicenseMIT

News REST Service

REST service based on ASP.NET Core Web API, Entity Framework Core and SQL Server that holds news.

Client Applications:

  • ASP.NET Core MVC
  • Xamarin Android

Endpoints:

  • GET /api/news – returns all news ordered by publish date.
  • POST /api/news – creates a news item by given title, content and publish date.
  • PUT /api/news/{id} – updates an existing news item by given id (given in the request URL) and title, content and publish date.
  • DELETE /api/news/{id} – deletes an existing news item by given id.

Features:

  • AutoMapper
  • EntityFramework Core with SQL Server and ASP.NET Identity
  • JWT authentication/authorization
  • File logging with Serilog
  • Stylecop
  • Neat folder structure
├───src
│   ├───configuration
│   └───server
│       ├───News.Api
│       ├───News.Business
│       ├───News.Core
│       ├───News.Data
│       └───News.Data.EntityFramework
└───tests
    └───News.Business.Tests

  • Swagger UI + Fully Documented Controllers

swagger-ui

  • Global Model Errors Handler

model-errors

  • Global Environment-Dependent Exception Handler
    Development
    exception-development
    Production
    enter image description here
  • Neatly organized solution structure
    solution-structure
  • Thin Controllers
    thin-controllers
  • Robust service layer using the Either monad.
    either-monad
  • Safe query string parameter model binding using the Option monad.
    optional-binding

Test Suite

  • xUnit
  • Autofixture
  • Moq
  • Shouldly
  • Arrange Act Assert Pattern

enter image description here