03 Oct 2019
Tags: AspNetCore cli




Easy steps on how to generate a asp net core controller (with entityframework support) via scaffolding.

Install the code generator package:

dotnet tool install -g dotnet-aspnet-codegenerator

Run:

dotnet aspnet-codegenerator controller -name EntityController -async -actions -m Entity -dc DbContext -udl

Flags:

Example:

dotnet aspnet-codegenerator controller -name ChannelsController -async -actions -m ChannelEntity -dc ApplicationDbContext -udl