Steps:
EntityFramework Core for MySql:
- Add entity framework core for mysql: dotnet add package MySql.Data.EntityFrameworkCore;
- Add entity framework design: dotnet add package Microsoft.EntityFrameworkCore.Design;
- Configure csproj file adding following two tools:
DbContext:
- Create Dbcontext: Inherit from DbContext;
- Implement IDesignTimeDbContextFactory
- Register in ConfigureServices
AutoMapper:
- install automapper: dotnet add package AutoMapper.Extensions.Microsoft.DependencyInjection --version 1.2.0;
- Register automapper: int Startup.cs: services.AddAutoMapper();
- Inherit Profile, CreateMap<>();
- Used in controller: mapper.Map();
Apis:
- Configure Makes, Features controllers
Angular:
- Install cli: sudo npm install @angular/cli@latest -g;
- Create new angular project: ng new hello-world;
- Copy .angular-cli.json to project folder;
- Change app-root-root:"src" into ClientApp;
- Add vehicle-form component and register in module.shared;
- Register new route for new component;
- Add new link to navigation bar;
- Mark up component.html
Services: to consume Apis
- Generate make service: ng g service make;
- Register make service into module as dependency injection provider;
- Confiture vehicle-form conponents.ts;
- Implement two-way binding for dropdown list;