• Home Page
ScottGeek Tech

On a Mission to Civilize

  • Home
  • Microsoft
    • Build2018
    • ASP.NET Core
    • .Net Core
    • REST
  • Home
  • Microsoft
    • Build2018
    • ASP.NET Core
    • .Net Core
    • REST

Site Topic Index

  • .Net,  Article,  Microsoft

    Article: .Net Framework 4.7.2 Now Available.

    May 3, 2018 / No Comments
    Announcing the .NET Framework 4.7.2
    A first-hand look from the .NET engineering teams
    blogs.msdn.microsoft.com

     

    Read Full Post
  • Article,  Microsoft

    Article: Windows 10 API and SDK for the April 2018 Update

    May 3, 2018 / No Comments

    Good read on what’s in the new Windows 10 update API’s and SDK…

    Start developing on Windows 10 April 2018 Update today
    Start developing on Windows 10 April 2018 Update today
     
    blogs.windows.com

     

    Read Full Post
  • .Net,  Microsoft

    MS Docs: .NET Framework Versions and Dependencies

    April 24, 2018 / No Comments

    Docs listing of the .Net versions etc.

    .Net Versions

    Read Full Post
  • Article,  CosmosDB,  Microsoft

    MS Docs: Azure CosmosDB: Develop with the SQL API in .NET

    April 24, 2018 / No Comments

    ,CloudGood step-through to get you started with CosmosDB and Azure:

    Azure CosmosDB SQL API in .Net

    Read Full Post
  • Microsoft,  Twitter

    Twitter: build poll

    April 24, 2018 / No Comments

    A Twitter Poll concerning MS build 2018 event.

    Check out @msdev’s Tweet: https://twitter.com/msdev/status/987380206179504128?s=09

    Read Full Post
  • Article,  Microsoft

    Create Service Fabric Clusters from Visual Studio now available | Blog | Microsoft Azure

    April 23, 2018 / No Comments

    https://azure.microsoft.com/en-us/blog/create-service-fabric-clusters-visual-studio/

    Read Full Post
  • .Net Core,  Microsoft

    .net Core 2.0 and SQL via EF Core 2.0

    January 31, 2018 / No Comments

    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>

    For local DB and table: “Server=(localdb)\mssqllocaldb;Database=Blogging;Trusted_Connection=True;” 

    For a real SQL Server connection instance: 

     Scaffold-DbContext "Server=Orion;DataBase=Blogging;Integrated Security=False;
    User ID=sa;Password=****;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True;
    ApplicationIntent=ReadWrite;MultiSubnetFailover=False"
    Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

    Also add the table parameter to get only certain tables   -table Blogs, Post
     

    So that was the Hard part… now some sample code:

    Make sure you add using Microsoft.EntityFrameworkCore; And if you put the dbContext into it’s own folder, make sure you include the class namespace.

    
    using System;
    using Microsoft.EntityFrameworkCore;
    using conAppSqlCore.Models;
    
    namespace conAppSqlCore
    {
        class Program
        {
            static void Main(string[] args)
            {
                Console.WriteLine("Hello World!");
                using (var db = new BloggingContext())
                {
                    foreach (var blog in db.Blog)
                    {
                        Console.WriteLine($"Name URL - {blog.Url}");
                    }
                }
                Console.ReadLine();
            }
        }
    }
    
    Read Full Post

The Cloud of Things

.Net • .Net Core • .Net Core 3.0 • .NET Framework • Article • ASP.NET Core • Azure • BizTalk • Build • Chrome • Cloud • Community Stand up Links • Community Toolkit • Containers • Core • CosmosDB • Docker • Entity Framework Core • FlipBoard • Free Courses • GitHub • IIS • Live Drawing • Mobile • Phone Posts • Photo Tech • Pinterest • Proxmox • Raspberry PI • REST • REST API • Security • Site News • SQL Server • Twitter • UWP • Visual Studio • Visual Studio 2017 • Visual Studio 2019 • WatchMaker • Windows 10 • WSL • Xamarin

Archives

Privacy Policy         ScottGeek - © 2025 All Rights Resevered