Giter Site home page Giter Site logo

coredemo's Introduction

Command list for .Net Core

Create new folder using CMD

* mkdir CoreDemo
* cd CoreDemo

Create solution and projects

* dotnet new sln -n=CoreDemo
* dotnet new angular -o Web
* dotnet new webapi -o WebApi
* dotnet new classlib -o ApplicationCore
* dotnet new classlib -o Infrastructure

Available project templates like web | webapi | console | classlib | mvc | xunit | angular
Here solution name will be as per folder name.

Add projects to solution file

* dotnet sln CoreDemo.sln add Web/Web.csproj
* dotnet sln CoreDemo.sln add WebApi/WebApi.csproj
* dotnet sln CoreDemo.sln add ApplicationCore/ApplicationCore.csproj
* dotnet sln CoreDemo.sln add Infrastructure/Infrastructure.csproj

* dotnet sln CoreDemo.sln remove Infrastructure/Infrastructure.csproj

Add reference of project to another project

* dotnet add Infrastructure/Infrastructure.csproj reference ApplicationCore/ApplicationCore.csproj
* dotnet add WebApi/WebApi.csproj reference ApplicationCore/ApplicationCore.csproj
* dotnet add WebApi/WebApi.csproj reference Infrastructure/Infrastructure.csproj

* dotnet remove WebApi/WebApi.csproj reference Infrastructure/Infrastructure.csproj

Restore / Build / Clean / Run / Publish

* dotnet restore
* dotnet build
* dotnet build --no-restore
* dotnet clean
* dotnet run --project Web/Web.csproj
* dotnet run --environment "Staging"
* dotnet publish --configuration {debug/release}
* dotnet test

Add packages for Entity framework core

* dotnet add Infrastructure/Infrastructure.csproj package Microsoft.EntityFrameworkCore.SqlServer
* dotnet add Infrastructure/Infrastructure.csproj package Microsoft.EntityFrameworkCore.Tools 
* dotnet add Infrastructure/Infrastructure.csproj package Microsoft.EntityFrameworkCore.SqlServer.Design
* dotnet restore

Create context class for Entity framework core

* dotnet ef dbcontext scaffold "Server=**[server]**;Database=**[database]**;User Id=**[username]**;Password=**[password]**;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -d -o Data -c "**[contextname]**" --project Infrastructure/Infrastructure.csproj --startup-project WebApi/WebApi.csproj

use --force to overwrite context file.

coredemo's People

Contributors

nilavpatel avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.