Housewives/Housewives.Api/Data/HousewivesDbContext.cs

123 lines
4.1 KiB
C#

using Housewives.Api.Entities;
using Microsoft.EntityFrameworkCore;
namespace Housewives.Api.Data
{
public class HousewivesDbContext : DbContext
{
public HousewivesDbContext(DbContextOptions<HousewivesDbContext> options):base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Housewife>().HasData(new Housewife
{
Id = 1,
Name = "Chanel Ayan",
Series = "The Real Housewives of Dubai",
ImageUrl= "https://i.dailymail.co.uk/1s/2022/06/02/08/58580139-10877237-image-a-10_1654154206127.jpg"
});
modelBuilder.Entity<Housewife>().HasData(new Housewife
{
Id = 2,
Name = "Sara Al Madani",
Series = "The Real Housewives of Dubai",
ImageUrl = "https://imgix.bustle.com/uploads/image/2022/6/1/7cbf222b-98cf-4c0b-9643-483ef07f19b9-nup_196331_01313.JPG?w=800&fit=crop&crop=focalpoint&auto=format%2Ccompress&fp-x=0.5787&fp-y=0.22"
});
modelBuilder.Entity<Housewife>().HasData(new Housewife
{
Id = 3,
Name = "Lisa Vanderpump",
Series = "The Real Housewives of Beverly Hills",
ImageUrl = "https://www.bravotv.com/sites/bravo/files/media_mpx/thumbnails/bravo-video.nbcuni.com/image/NBCU_Bravo/561/911/161202_3434774_This_Is_How_Dorit_and_Lisa_Vanderpump_Became.jpg"
});
modelBuilder.Entity<Housewife>().HasData(new Housewife
{
Id = 4,
Name = "Heathere Gay",
Series = "The Real Housewives of Salt Lake City",
ImageUrl = "https://static.wikia.nocookie.net/realitytv-girl/images/4/42/Heather_Gay.jpg/revision/latest?cb=20210509144203"
});
modelBuilder.Entity<Quote>().HasData(new Quote
{
Id = 1,
HousewifeId = 1,
Phrase = "But I'm going to enjoy my life just like I was born today.",
Season = 1,
Episode = 9
});
modelBuilder.Entity<Quote>().HasData(new Quote
{
Id = 2,
HousewifeId = 1,
Phrase = "Be careful who you surround yourself with. You might pick their fashion sense.",
Season = 1,
Episode = 11
});
modelBuilder.Entity<Quote>().HasData(new Quote
{
Id = 3,
HousewifeId = 2,
Phrase = "You're bleeding on people who did not cut you.",
Season = 1,
Episode = 3
});
modelBuilder.Entity<Quote>().HasData(new Quote
{
Id = 4,
HousewifeId = 3,
Phrase = "I'm passionate about dogs, just not about crazy bitches.",
Season = 6,
Episode = 0
});
modelBuilder.Entity<Quote>().HasData(new Quote
{
Id = 5,
HousewifeId = 3,
Phrase = "Life isn't all diamonds and rose, but it should be.",
Season = 3,
Episode = 0
});
modelBuilder.Entity<Quote>().HasData(new Quote
{
Id = 6,
HousewifeId = 4,
Phrase = "For me, the fairytale is the be seen for exactly who I am, and to still be loved.",
Season = 1,
Episode = 4
});
modelBuilder.Entity<Tag>().HasData(new Tag {
Id = 1,
Name = "Advice"
});
modelBuilder.Entity<Tag>().HasData(new Tag
{
Id = 2,
Name = "Funny"
});
}
public DbSet<Housewife> Housewives { get; set; }
public DbSet<Quote> Quotes { get; set; }
public DbSet<Tag> Tags { get; set; }
}
}