.Net Core

Matters related to .Net Core

  • .Net Core,  Microsoft

    Dotnet Core Templates, or DOTNET new -i “the magic”

    Time to touch on this topic again… because every time a new DOTNET SDK comes out I seem to lose the new templates. I understand the why, and ya I wish the .Net Core group would fix it.  The “why”- each time one updates to a new Core SDK, the template scaffolds get placed into a new folder (usually under your users directory in a annoying place like ….\.templateengine\dotnetcli\”version of sdk”\). So each time you move to a new DOTNET SDK, this becomes a problem. The second part of of DOTNET new -i that is an issue, is if you have different nuget repositories set in VS. It’s a great…

  • .Net Core,  Microsoft

    .net Core 2.0 and SQL via EF Core 2.0

    So I can never remember the order that these goes in so Here we go:  A console App with .net Core/SQL Server/EF Core 2.0 – In VS 2017 – Create a in .Net Core a Console App (.NET CORE) -Package Manager Console:  Install-Package Microsoft.EntityFrameworkCore.SqlServer  [Current Version was 2.0.1] Install-Package Microsoft.EntityFrameworkCore.Tools  [Current Version was 2.0.1] Install-Package Microsoft.EntityFrameworkCore.SqlServer.Design  [Not sure this one is required] Now let’s say we have a database and table…. Let’s reverse engineer it! Scaffold-DbContext “<that magic connect string>” Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models   This is command that will use the <that magic connect string> and the provider Microsoft.EntityFrameworkCore.SqlServer with the code generation going into the Models sub-directory.  Examples <that magic connect string>…