Sample codes of "Dependency Injection With .NET Core 3" course on Udemy
This simple code is to demonstrate how to do simple operations with DI in .NET Core and ASP.NET Core By default, it uses AWAS DynamoDB. To use DynamoDB, you must create your own local .aws account profile and include "user key", "secret key" and "region" in it.
There is an implementation of IDataService that works with SQL Server. It is called SqlServerDataService
If you would like to switch to SQL Server you must do the following:
- Create an empty new database in your SQL Server (or SQL Server Express)
- Open script file from PersonalBlog\DatabaseScripts folder (this one)
- Run the script on the newly created databases to have the tables and stored procedures created
- Go to appsettings.json, and update the "SqlConnection" key with the proper connection string that works with your database
- Go to Startup.cs, and comment out the existing "ConfigureDataService" method which works with DynamoDB
- Uncomment "ConfigureDataService" that works with SqlServer (injects SqlServerDataService)