27 lines
666 B
C#
Raw Normal View History

2016-11-22 18:40:47 +01:00

namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure
{
using AspNetCore.Builder;
using Microsoft.EntityFrameworkCore;
using Ordering.Infrastructure;
using System.Threading.Tasks;
public class OrderingContextSeed
{
public static async Task SeedAsync(IApplicationBuilder applicationBuilder)
{
var context = (OrderingContext)applicationBuilder
.ApplicationServices.GetService(typeof(OrderingContext));
using (context)
{
context.Database.Migrate();
await context.SaveChangesAsync();
}
}
}
}