YoVDO

An Opinionated, Maintainable REST API Architecture for ASP.NET Core

Offered By: NDC Conferences via YouTube

Tags

NDC Conferences Courses ASP.NET Core Courses Scalability Courses Dependency Injection Courses CQRS Courses

Course Description

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Explore an opinionated and maintainable REST API architecture for ASP.NET Core in this conference talk. Learn how to create scalable APIs that avoid common pitfalls of scaffolding and poor separation of concerns. Discover techniques for dependency injection, request validation, service execution, error handling, and versioning strategies. Gain insights into implementing CQRS, separating entities from models, using Fluent Validation, and leveraging MediatR for request handling. Understand the benefits of using Autofac for dependency injection and creating repeatable patterns. Get tips on writing comprehensive tests and keeping API versions separate to ensure long-term maintainability and scalability of your ASP.NET Core-powered RESTful APIs.

Syllabus

Intro
SETTING THE STAGE "We need a new SPA "We need a new REST API
ZERO TO "MAKE MAGIC HAPPEN"
THE EMPLOYEE OBJECT • Is part of payroll software • Contains sensitive data (SSN)
A WILD EmployeesController APPEARED
The reality SCAFFOLDING IS A LIE
Route the request Validate Run service for request Return data
NO SEPARATION OF CONCERNS
CONTROLLER SHOULD ONLY Route the request Return data
CQRS Command Query Responsibility Segregation
Problem? ENTITY BEING USED FOR REQUESTS MODEL/MODEL VALIDATION ARE NOT SEPARATE
SEPARATE ENTITY FROM MODEL So let's refactor
SEPARATE VALIDATION FROM MODEL INTRODUCING FLUENT VALIDATION
ISOLATE VALIDATION FUNCTIONALITY
SEPARATE REQUEST HANDLER FROM CONTROLLER INTRODUCING MEDIATR
PUTTING IT ALL TOGETHER 1. Dependency injection handles... dependencies 2. Mediat will handle request/responses 3. Controller will route HTTP requests
USE BETTER DI CONTAINER INTRODUCING AUTOFAC
USE AUTOFAC TO • Scan assemblies for services/validators • Add them to service pipeline
TIPS
CREATE REPEATABLE PATTERNS more complete example
WRITE TESTS FOR EVERYTHING
KEEP VERSIONS SEPARATE
CONCERNS May be unnecessary complexity • Bigger learning curve


Taught by

NDC Conferences

Related Courses

AngularJS: Framework Fundamentals
Microsoft via edX
Архитектура Android-приложений
Moscow Institute of Physics and Technology via Coursera
Client-based Web Applications development: ReactJS & Angular
Universidad Politécnica de Madrid via Miríadax
Getting Started with Blazor Server
Coursera Project Network via Coursera
Getting Started with Blazor WASM
Coursera Project Network via Coursera