This repository contains an ASP.NET Core Web API sample that applies fundamental principles that lie at the foundation of functional programming, giving you insight into how your REST API will behave.
Applying functional programming principles can give you the ability to create robust applications that quickly adapt to ever-changing market needs. I strongly recommend you to check this course: Applying Functional Principles in C#.
The Customer Management sample was adapted from Vladimir Khorikov's repository in order to provide an ASP.NET Core version and some refactorings to adhere more clean code principles.
Some concepts used in this sample:
- Command-query Separation principle (CQS): Functions that change state (side effect) should not return values and functions that return values should not change state.
- Fail-Fast Principle: Stopping the current operation as soon as any unexpected error occurs.
- Don't Repeat Yourself Principle (DRY): Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
- Non-nullable reference types: Type whose instances can't turn into null in any way.
- Railway Oriented Programming: A functional approach for error handling.