Based on the Json file, the model should like this: public class Laureate { public string id { get; set; } public string firstname { get; set; } public string surname { get; set; } public string motivation { get; set; } public string share { get; set; } } public class Prize { public string year { get; set; } public string category { get; set; } public List laureates { get; set; } public string overallMotivation { get; set; } } Then, you can add the `DbSet` in the `ApplicationDbContext` and you can use the `HasKey` method to set the primary key. public class ApplicationDbContext : DbContext { public ApplicationDbContext (DbContextOptions options) : base(options) { } public DbSet Prizes { get; set; } public DbSet Laureates { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity() .HasKey(c => c.year); modelBuilder.Entity() .HasKey(c => c.id); } } And in the program file, it is an asp.net 6 sample. register the applicationdbcontext and add the connection string in the appsettings.json file. program.cs file: var builder = WebApplication.CreateBuilder(args); builder.Services.AddDbContext(options => options.UseSqlServer(builder.Configuration.GetConnectionString("ApplicationDbContext"))); appsettings.json file: "ConnectionStrings": { "ApplicationDbContext": "Server=(localdb)\\mssqllocaldb;Database=WebApplication8.Data;Trusted_Connection=True;MultipleActiveResultSets=true" } Then you can open the Package Manage Console and run the following commands to enable migration and generate the relate table in the database. To seed the database. you can create a SeedData class like this: public static class SeedData { public static void Initialize(IServiceProvider serviceProvider) { using (var context = new ApplicationDbContext( serviceProvider.GetRequiredService>())) { // Look for any Laureates or Prizes. if (context.Laureates.Any() || context.Prizes.Any()) { return; // DB has been seeded } //get the json file from the wwwroot folder. var env = serviceProvider.GetRequiredService(); var path = Path.Combine(env.WebRootPath, "files", "Laureate.json"); //read the json content and then deserialize it to object, var jsonString = System.IO.File.ReadAllText(path); if (jsonString != null) { #pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type. Prize item = System.Text.Json.JsonSerializer.Deserialize(jsonString); #pragma warning restore CS8600 // Converting null literal or possible null value to non-nullable type. if (item != null) { context.Prizes.Add(item); //insert the data to the database. context.SaveChanges(); } } } } } Then add the seed initializer in the program.cs file: var app = builder.Build(); using (var scope = app.Services.CreateScope()) { var services = scope.ServiceProvider; SeedData.Initialize(services); }