Sunday, 21 May 2023

Create database in efcore

 go to project root dir and run these commands 

dotnet tool install --global dotnet-ef
dotnet add package Microsoft.EntityFrameworkCore.Design
dotnet ef migrations add InitialCreate
dotnet ef database update

 

connection string will be like this 

 "ConnectionStrings": {
    "database": "server=.;database=low2high;integrated security=true;TrustServerCertificate=True"
  }

Monday, 8 May 2023

Copy rows from the same table and update the ID column

 

INSERT INTO ProductDefinition (ProdID, Definition, Desc)
SELECT
  xxx, Definition, Desc
FROM
  ProductDefinition
WHERE
  ProdID = yyy

Sunday, 7 May 2023

Docker - How to build image, run it and push it


how to build docker image
docker build -t passwordapi .

how to run docker image, set environment variable and expose port
docker run --name passwordapi -e ConnectionString="mongodb://localhost:27017"  -p 13734:80 passwordapi

how to push image to dockerhub
docker tag passwordapi:latest nageshajab/passwordapi
docker push nageshajab/passwordapi

Search This Blog

Creating your first "Alexa" Skill

Index What is Alexa What is Alexa Skill? Why is it required when Alexa already equipped with voice assistant? Dev...