Skip to content

Latest commit

 

History

History
45 lines (28 loc) · 1.47 KB

File metadata and controls

45 lines (28 loc) · 1.47 KB

CHAPTER 04

Generate Code

Create the server projects

After completing the installation steps, you are ready to generate your own solution. The following commands use the project name Sample with a new module named Clock but you can use any valid namespace names of your own.

md Sample
cd Sample
dotnet new indymicro-infrastructure -n Sample.Infrastructure
dotnet new indymicro-context -n Sample.Context
dotnet new indymicro-host -n Sample.Host
dotnet new indymicro-module -n Sample.Module.Clock --ModuleName Clock
dotnet new sln Sample
dotnet sln add Sample.Host
dotnet sln add Sample.Infrastructue
dotnet sln add Sample.Context
dotnet sln add Sample.Module.Clock
  • In the Clock project, check the references to your Infrastructure and Context projects.
  • In the Host project, check the references to your Infrastructure and Context projects. For debugging, it is also much easier to add a reference to the Clock module project as well so go ahead and do that. (For production, you can load modules dynamically instead of linking to the host like this.)
  • In the Host project, find the appsettings.json file and review the settings. Your Clock module settings will use sqlite for the DatabaseType by default.
dotnet build
dotnet run

You should now be able to see server output in the console.

You can aslo check your API document generated by swagger like this:

https://localhost:5001/swagger/index.html

< Back