Skip to main content

Posts

Showing posts from July, 2024

Database connectivity in ASP.net core , .NET Core DB Connection, step by step

Database connectivity in ASP.net core , .NET Core DB Connection, step by step  Step1st: Create ASP.NET Core Project Step2nd: Manage Nuget Package Manager Console  Microsoft.EntityFrameworkCore 7.0 Microsoft.EntityFrameworkCore.SqlServer 7.0 Microsoft.EntityFrameworkCore.Tools 7.0 Step3rd: Create Model Class namespace WelcomeProject.Models {     public class Product     {         public int Id { get; set; }         public string Name { get; set; }         public decimal Price { get; set; }     } } Create AppDbContext Class also under model using Microsoft.EntityFrameworkCore; using System.Collections.Generic; namespace WelcomeProject.Models {     public class AppDbContext : DbContext     {         public DbSet<Product> Products { get; set; }         private readonly IConfiguration _configuration;         ...