question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create cross platform dotnet global tool

See original GitHub issue

Why? EF Core Power Tools reverse engineering at this point includes an abundance of features that are unavailable or hard to achieve with the default command line tooling, and providing these features on other platforms is requested by a number of users.

Additional features include:

  • stored procedure and functions mapping (for Azure SQL / SQL Server)
  • advanced stored procedure result set discovery options
  • use EF 6 classic pluralizer
  • customize Humanizer pluralizer (exclude words)
  • drop T4 templates
  • warn if t4 templates are old
  • remove obsolete files
  • treat bool default values more like users expect
  • split DbContext into EntityConfiguration classes
  • enable type mappings (spatial, hierarchyid, DateOnly, TimeOnly, NodaTime)
  • rename table and column names
  • provide instructions on packages to install and DI configuration

Syntax

efcpt "<connection string/.dacpac path>" <provider name/abbreviation>

Examples

efcpt "server=.;database=Chinook" Microsoft.EntityFrameworkCore.SqlServer

efcpt "server=.;database=Chinook" mssql

efcpt "/mydatabase.dacpac" mssql

Must haves

  • Create initial net6.0 tool project supporting EF Core 7
  • package name: ErikEJ.EFCorePowerTools.Cli, tool name; efcpt
  • Use https://www.nuget.org/packages/CommandLineParser/
  • use new config file format, create class and serialization (see below) in RevEng.Common
  • add mapping of provider names and aliases
  • add mapper to internal options format - also merge with existing epft.renaming.json file in RevEng.Common
  • Auto create config file on first run with good defaults if it does not exist
  • propose useful default DbContext name
  • help with samples (using command line help features)
  • Improve output (Spectre.Console)
  • versioning and publishing to NuGet (will do manually initially)
  • Update objects list on each run (and preserve “exclude” and sproc options)
  • Show instructions for DI config and package install after running
  • compose and drop “readme”
  • add package readme
  • Use json schema for config file - located in repo
  • include and drop t4 templates if opted in
  • obsolete template warning

After preview 1 (to be ported/refactored from VS extension)

  • Support EF Core 6/8 - explicit older/newer version of tool

TBD

  • banner? (Using Figgle perhaps?)
  • enable wildcard object filtering

Unsupported features (currently)

  • navigation renaming
  • column exclusions
  • schema filter
  • merging of .dacpacs
  • default .dacpac schema
  • postrun.cmd

@bricelam @ajcvickers FYI

Issue Analytics

  • State:closed
  • Created 6 months ago
  • Reactions:10
  • Comments:32 (20 by maintainers)

github_iconTop GitHub Comments

3reactions
ErikEJcommented, Apr 25, 2023

Preview 1 of the CLI tool is now available

image

1reaction
ErikEJcommented, Jun 15, 2023

@antonio1612 no. Why do you need it? Just use dotnet ef

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tutorial: Create a .NET tool using the .NET CLI
This tutorial teaches you how to create and package a .NET tool. The .NET CLI lets you create a console application as a...
Read more >
Using .NET Core Tools to Create Reusable and Shareable ...
NET Core Tool provides you with cross-platform functionality without having to build and maintain multiple platform-specific loaders and it keeps the ...
Read more >
Creating a .NET Global Tool from an existing Console ...
Create a new .NET Core Console Application; Add Global Tool Specific NuGet tags to the .csproj; Build your Console application and test it ......
Read more >
How to publish a dotnet global tool with .NET Core 2.1
.NET Core global tools provide a simple way to create and share cross-platform console tools. There are so easy to create. I think...
Read more >
Creating a Custom .NET Core Global Tool | by Changhui Xu
The Global Tool model is essentially another publishing method for Console applications, which packs a Console app as a NuGet package. Once the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found