August 2018
Intermediate to advanced
298 pages
5h 33m
English
Once we have defined our database context, the next step is to generate migrations. However, since we now have an infrastructure project, we would prefer our infrastructure project to be the host of our migrations.
To do that, follow these steps:
using Microsoft.EntityFrameworkCore;using Microsoft.EntityFrameworkCore.Design;using Microsoft.EntityFrameworkCore.Infrastructure;using RestBuy.Infrastructure.EF;using System;using System.Collections.Generic;using System.Text;namespace RestBuy.Infrastructure.EF{ class RestBuyContextFactory : IDesignTimeDbContextFactory<RestBuyContext> { public RestBuyContext CreateDbContext(string[] ...Read now
Unlock full access