Steps to use EF Core in project. (easy)
>> Go to Nuget packages and install "Microsoft.EntityFramework.SqlServer". This will install few more dependent packages with it.
>> Right click and create a folder named "Database"
>> Add a class and named it AppDbContext.cs (it could be any name)
>> Inherit the above class with "DbContext" class. "DbContext" class is available when we use 'using Microsoft.EntityFrameworkCore;' on top of a class file.
>> Create entities (tables) classes in model folder (or in same folder)
>> Create DB set property for above model class in AppDbContext class.
public class AppDBContext: DbContext{public AppDBContext(DbContextOptions<AppDBContext> options) : base(options){}public DbSet<Student> Students { get; set; }}
>> Now register the DBContext class in startup.ConfigureService method.
public void ConfigureServices(IServiceCollection services){services.AddDbContext<AppDBContext>(options =>options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));}