Home Asp.net MVC React with Asp.Net Core web Api Full Stack Crud Application

React with Asp.Net Core web Api Full Stack Crud Application

12 min read
0
0
2,399

This tutorial will teach you how to make Crud Application using Asp.net Core Entity Framework with React  Frontend application and Sqlserver Database using Api access Crudapplication.this tutorial explains the Code First approach.

Install the required Dependencies

Microsoft.EntityFrameworkCore.Design
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Tools
Newtonsoft.Json

First Step Select the Model Folder Right Click and Create the Class Student.cs

Student.cs

StudentDbContext
Program.cs

Add these Context inside the Program.cs  file

Establish the Database Connection

builder.Services.AddDbContext<StudentDbContext>(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString(“StudentDbContext”)));

Connect the WebApi for Allow the Permissions

app.UseCors(policy => policy.AllowAnyHeader()
.AllowAnyMethod()
.SetIsOriginAllowed(origin => true)
.AllowCredentials());

I attached the full code of Program.cs file where you going paste the above code.

appsettings.json

Paste the ConnectionStrings

After that Go to Tools->NuGet Package Manager->Package Manager Console

then you can get the console . you have add-migration initial

then migration files has been created.

after that you have run the command as

    Load More Related Articles
    Load More By admin
    Load More In Asp.net MVC

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    Check Also

    Create Maven project in Intellij

    In this tutorial will see how to create Maven project in Intellij step by step. First Step…