Difference between forms, mvc, core
Cross platforms
Only on windows
Core run on platforms.
Performance no page Lifecycles. Ddl are modular and less size. Memory footprint less
Core simplifies development with centralised configuration, built in Dependency Injection
Core is cloud ready and mvc not that complete
Webbforms not meant for cloud because at the cloud was that dominant
Wwwroot folder
Static contents js css files
Appsettings
Json
Name value pair
App configurations. Can be grouped
How to read configuration
IConfiguration service of app wires us configuration settings from all providers.
We inject that service to controller or services
We either use key or bind to a class
Can use options pattern
Dependency Injection
Practice of a provider providing a consumer class with its dependent objects
Benefit: centralised dependencies. Decoupled system. Refactor by changing at one place
Benefits of dependency Injection
Decoupling systems
Centralised
What are middlewares
Middleware are software components kept as a pipeline in front of endpoint
in a specific order
Which can do pre processing of request before endpoint execution and post processing of response after it.
Each middleware can inspect and modify. Either forward the request or short circuit and send a response
This way we can handle repeated concerns of request handling in a centralised way without repeating code in endpoints
We can also maintain and test better with unit testing. Configurable and refactor also easier in one place