Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using BeerOverflowAV.Data.Entities;
- using Microsoft.EntityFrameworkCore;
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace BeerOverflowAV.Data.Seeder
- {
- public static class ModelBuilderExtension
- {
- public static void Seeder(this ModelBuilder builder)
- {
- //Country
- builder.Entity<Country>().HasData(
- new Country
- {
- Id = Guid.Parse("253ad297-7da0-4302-a211-6d8b80cabfa0"),
- Name = "Bulgaria",
- },
- new Country
- {
- Id = Guid.Parse("889a4666-7cd4-4733-946c-3960d8826b5d"),
- Name = "Serbia",
- },
- new Country
- {
- Id = Guid.Parse("59e77aef-0550-4eeb-864a-7c17b3696e77"),
- Name = "Romania",
- });
- //Brewery
- builder.Entity<Brewery>().HasData(
- new Brewery
- {
- Id = Guid.Parse("993d7431-0be5-4479-b8c2-9e1c53ca7e67"),
- Name = "KamenitzaAD",
- CountryId = Guid.Parse("253ad297-7da0-4302-a211-6d8b80cabfa0"), // the same as Bulgaria Guid
- },
- new Brewery
- {
- Id = Guid.Parse("839d494c-840c-432b-be31-9765750bad14"),
- Name = "Zajchar",
- CountryId = Guid.Parse("889a4666-7cd4-4733-946c-3960d8826b5d"), // the same as Serbia Guid
- },
- new Brewery
- {
- Id = Guid.Parse("0c87b7f9-317c-43d3-abbb-42a1365362b1"),
- Name = "Timisoara",
- CountryId = Guid.Parse("59e77aef-0550-4eeb-864a-7c17b3696e77"), // the same as Romania Guid
- });
- //Style
- builder.Entity<Style>().HasData(
- new Style
- {
- Id = Guid.Parse("7809e394-4bdf-42b6-8504-920da3a26a80"),
- Name = "BatkaStyle",
- },
- new Style
- {
- Id = Guid.Parse("ebb0a604-505e-43ba-a0d4-896d4a703f8d"),
- Name = "BrateStyle",
- },
- new Style
- {
- Id = Guid.Parse("66bc75dd-b894-43a4-afb1-6a79bba8f316"),
- Name = "MamaligaStyle",
- });
- //Beer
- builder.Entity<Beer>().HasData(
- new Beer
- {
- Id = Guid.Parse("b013d5d2-3348-4daa-9a94-0aeee86e44c5"),
- Name = "Burgasko",
- Brand = "Burgasko",
- CountryId = Guid.Parse("253ad297-7da0-4302-a211-6d8b80cabfa0"),
- StyleId = Guid.Parse("7809e394-4bdf-42b6-8504-920da3a26a80"), //the same as Batka Style Id
- BreweryId = Guid.Parse("993d7431-0be5-4479-b8c2-9e1c53ca7e67"), //the same as KamenitzaAD Id
- ABV = double.Parse("4.5"),
- },
- new Beer
- {
- Id = Guid.Parse("66337ae1-5a6f-4e5f-801b-ba18efd206e3"),
- Name = "Zajecharsko",
- Brand = "Zajchersko",
- CountryId = Guid.Parse("889a4666-7cd4-4733-946c-3960d8826b5d"),
- StyleId = Guid.Parse("ebb0a604-505e-43ba-a0d4-896d4a703f8d"), //the same as Brate Style Id
- BreweryId = Guid.Parse("839d494c-840c-432b-be31-9765750bad14"), // the same as Zajchar Brewery Id
- ABV = double.Parse("3.5"),
- },
- new Beer
- {
- Id = Guid.Parse("e2e4bfd0-95e8-4b19-8666-731594961eb1"),
- Name = "Ursus",
- Brand = "Ursus",
- CountryId = Guid.Parse("59e77aef-0550-4eeb-864a-7c17b3696e77"),
- StyleId = Guid.Parse("66bc75dd-b894-43a4-afb1-6a79bba8f316"), //the same as Mamaliga Style Id
- BreweryId = Guid.Parse("0c87b7f9-317c-43d3-abbb-42a1365362b1"), // the same as Timisoara Brewery Id
- ABV = double.Parse("5.5"),
- }
- );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment