SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using FootballSystemHomework.Data.Context;
  2. using Microsoft.EntityFrameworkCore;
  3. using Microsoft.Extensions.DependencyInjection;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Text;
  7.  
  8. namespace FootballSystemHomework.Data.Models
  9. {
  10.     public static class SeedData
  11.     {
  12.         public static void Initialize(IServiceProvider serviceProvider)
  13.         {
  14.             using (var context = new FootballContext(
  15.                 serviceProvider.GetRequiredService<
  16.                     DbContextOptions<FootballContext>>()))
  17.             {
  18.                 context.Database.EnsureCreated();
  19.             }
  20.         }
  21.     }
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top