GithubHelp home page GithubHelp logo

junxian428 / aspnet_core_api_learning Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 8.21 MB

MAKE API with Microsoft SQL. LEARNING ๐Ÿ˜ƒ Refer this: https://youtu.be/EmV_IBYIlyo

C# 100.00%
learning api

aspnet_core_api_learning's Introduction

ASPNET_CORE_API_LEARNING

Reference: https://github.com/teddysmithdev/pokemon-review-api/tree/master/PokemonReviewApp

Step 1- Create Model Class

Step 2- Declare relationship

Step 3- DbContext

Step 4- Connect to database (Nuget Manager - Find )

"DefaultConnection": "Data Source=LAPTOP-PVLCOKUM;Initial Catalog=pokemonreview;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"

Step 5- Seeding (By creating the inital object to be stored in the database)

Step 6- Open Package Manager Console (Create Migration files)

Command: Add-Migration InitialCreate

(if command is not found, please run dotnet add package Microsoft.EntityFrameworkCore.Tools)

Step 7- To migrate into database

Command: Update-Database


Step 8- Run database seed otherwise database no initial data

Directory: C:\Users\junxian428\source\repos\SSLAPI\SSLAPI

Mode LastWriteTime Length Name


d----- 4/26/2023 9:27 PM bin

d----- 4/26/2023 9:37 PM Controllers

d----- 4/27/2023 8:12 AM Data

d----- 4/27/2023 8:45 AM Migrations

d----- 4/27/2023 8:23 AM Models

d----- 4/27/2023 8:45 AM obj

d----- 4/26/2023 9:27 PM Properties

-a---- 4/26/2023 9:27 PM 127 appsettings.Development.json

-a---- 4/26/2023 10:25 PM 444 appsettings.json

-a---- 4/27/2023 8:32 AM 1185 Program.cs

-a---- 4/27/2023 8:22 AM 5949 Seed.cs

-a---- 4/27/2023 8:45 AM 747 SSLAPI.csproj

PS C:\Users\junxian428\source\repos\SSLAPI\SSLAPI> dotnet run seeddata

Step 9- Check database

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.