Writing the EntityFrameworkCoreData class
In this section, we will be writing the methods for our Entity Framework data access class. The code we will write in this section will be executed in the next chapter. Follow these steps:
- Open the
EntityFrameworkCoreData
class and edit it as follows:using CH10_DataAccessBenchmarks.Models; using Microsoft.EntityFrameworkCore; using System.Collections.Generic; using Microsoft.Data.SqlClient; using System.Linq; using Microsoft.EntityFrameworkCore.SqlServer .Infrastructure.Internal; public class EntityFrameworkCoreData : DbContext { private string _connectionString = string.Empty; public DbSet<Product> Products { get; set; } public EntityFrameworkCoreData(string connectionString) : base(GetOptions (connectionString...