Demo Application for the course Back-end fundamentals
- .NET Project Structure and Project Types
- Basic dotnet CLI commands.
- Editors/IDEs for .net/C#
- Initial Project Architecture
- UML Illustrating Projects and Dependencies
- Register Expense
- Unit Testing with xUnit
- Service objects
- Repository objects
- Testing using Fake Implementation
- Retrieve all Expenses
- Enumerables in C#
- WebApi Project
- .NET 7 WebApi Project
- Controllers
- Routing
- HTTP Verbs
- Dependency Injection Configuration (DIP Principle)
- Swagger and Swagger UI
- Refactor: Introduce IExpensesService interface
- Using interfaces to facilitate testing with test doubles
- Contracts Project
- Data Transfer Objects
- Requests: Input DTOs
- Responses: Output DTOs
- Storage Project
- Moving Storage access to a separated project
- Filter Expenses by Category
- LINQ to Object Collections
- Query String Parameters in Controllers
- Get Expense by Id
- Route Parameters
- Get Expense, Id Not Found
- Nullable Types
- HTTP Response Codes
- ProduceResponseType Attribute
- ActionResult Subtypes
- Validate Expense on Registration
- DataAnnotations Attributes
- ModelStateDictionary
- 400 Bad Request Response
- UnitTesting Validations
- Generic Validator
- ValidationContext
- Storage.EntityFramework Project
- DbContext and DbSets
- DbContext Configuration
- Installing dotnet ef CLI tools
- Create Initial Migration
- Applying Initial Migration to Database
- Expense Description
- Applying Changes Iteratively with Migrations
- Expense Invoice URL
- Expense Created Date
- Deterministic UnitTesting
- Techniques to make unit tests deterministic
- Refactor: Introduce Categories Table
- Database Normalization
- Refactoring internal Entities without affecting Contract (Orthogonality)
- Migration Data: Avoiding data lost in Migrations
- Create Expenses - Category Does not Exist
- Tupples in C#
- Result Object Pattern
- Bufix: Include Category in Expense
- Eager Loading
- Lazy Loading
- Integration Tests
- Types of Unit Testing
- Integration Testing
- WebApplicationFactory
- HttpClient
- Refactor: Move Validations to Service
- Thin Controllers
- Delete Expense
- Update Expense
- Sign Up
- Password Hashers: BCrypt
- Token Generation
- Jwt Token Generation
- Claims
- Token Signature
- Configuring Authentication and Authorization
- Password verification
- AddAuthentication
- useAuthorization
- Bearer Token Header
- Authorization attribute
- Relate Expenses and User
- Mock password Hasher
- Mocks: Moq
- Fast Unit Tests
- Move Sensitive Data to Config
- IConfiguration
- appsettings.json
- Database Seed
- Organize Dependency Injection Config
- Extensions Methods
- Switch Storage by Config
Download and Install .net 7.
Open a terminal and run
dotnet --version
Install Entity Framework Core tools reference - .NET Core CLI following this instructions.
dotnet build
dotnet test
dotnet run --project Okane.WebApi/Okane.WebApi.csproj
dotnet tool install --global dotnet-ef
dotnet tool update --global dotnet-ef
dotnet ef