Author : HASSAN MD TAREQ | Updated : 2020/08/02

Procedure to start new development

  • Create visual studio solution
    • Decide solution name
    • Decide project names
  • Bare minimun core for git reposity
  • Create repository & put bare minimun core:
    • Azure DevOps
    • Github
    • Gitlab (public/private)
  • Add SSH key to repository
    • Install Git for windows
    • Open Git GUI > Help > SSH key > Generate (will ask for password > ok > ok)
    • Repository Settings > Add SSH key
  • Clone repository
  • Add nuget packages
  • EF Core Data Project
  • Create domain project
    • All business logic should be in domain project
    • IFooService & FooService: will be registered to DI container in Startup class
    • EF Core data project will be used in domain project
    • UI models and (EF Core) Data Models will be seperated
    • AutoMapper will be used for: UI models <-> (EF Core) Data Models
  • Create unit testing project: xUnit

Scaffolding CRUD in Visual Studio

As of 2020.07.24, VS 2019 does not support scaffolding CRUD using EF Core DbContext for Blazor.

We need to do it manually

EF Core Data Project

We need to create EF Core Data project and that Data project will be used in our CRUD app.

Build the data project to make sure everything is working.

Using Data Project in Blazor App

  • Blazor App > Right Click > Build Dependencies > Project Dependencies…
  • Select the Data Project (Checked) > OK
  • EF Core Nuget Package
    • Blazor App > Right > Manage Nuget Packages…
    • Browse > Search: “Microsoft.EntityFrameworkCore.SqlServer” > Install
    • Or PMC: Install-Package Microsoft.EntityFrameworkCore.SqlServer
  • Build the Blazor App > Data project model classes will be available to use