using Microsoft.EntityFrameworkCore; using Blueprint.Core.Entities; namespace Blueprint.Infra.Database { public class DbInitializer { private readonly ModelBuilder? modelBuilder; public DbInitializer(ModelBuilder modelBuilder) { this.modelBuilder = modelBuilder; } public void Seed() { modelBuilder?.Entity().HasData( new User() { Id = 1, Name = "Test", Email = "", Status = true, Date = DateTime.Now, Modified = DateTime.Now, }, new User() { Id = 2, Name = "Truong Dang", Email = "truongdxfx08031@funix.edu.vn", Status = true, Date = DateTime.Now, Modified = DateTime.Now, }, new User() { Id = 3, Name = "Thai Son", Email = "truonghusk17aws1@gmail.com", Status = true, Date = DateTime.Now, Modified = DateTime.Now, } ); modelBuilder?.Entity().HasData( new Category() { Id = 1, Name = "Item 1", Status = true, Date = DateTime.Now, Modified = DateTime.Now, }, new Category() { Id = 2, Name = "Item 2", Status = true, Date = DateTime.Now, Modified = DateTime.Now, } ); modelBuilder?.Entity().HasData ( new Product() { Id = 1, Name = "Item 1", CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Premtilmiue.png", Status = true, Date = DateTime.Now, Modified = DateTime.Now, CategoryId = 1, }, new Product() { Id = 2, Name = "Item 2", CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Protile.png", Status = true, Date = DateTime.Now, Modified = DateTime.Now, CategoryId = 2, }, new Product() { Id = 3, Name = "Item 3", CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Supertile.png", Status = true, Date = DateTime.Now, Modified = DateTime.Now, CategoryId = 2, }, new Product() { Id = 4, Name = "Item 4", CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-Sealant-HP.jpg", Status = true, Date = DateTime.Now, Modified = DateTime.Now, CategoryId = 1, }, new Product() { Id = 5, Name = "Item 5", CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-.jpg", Status = true, Date = DateTime.Now, Modified = DateTime.Now, CategoryId = 2, }, new Product() { Id = 6, Name = "Item 6", CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-1.jpg", Status = true, Date = DateTime.Now, Modified = DateTime.Now, CategoryId = 2, }, new Product() { Id = 7, Name = "Item 7", CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-303.jpg", Status = true, Date = DateTime.Now, Modified = DateTime.Now, CategoryId = 1, }, new Product() { Id = 8, Name = "Item 8", CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Premtilmiue.png", Status = true, Date = DateTime.Now, Modified = DateTime.Now, CategoryId = 2, }, new Product() { Id = 9, Name = "Item 9", CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Protile.png", Status = true, Date = DateTime.Now, Modified = DateTime.Now, CategoryId = 2, }, new Product() { Id = 10, Name = "Item 10", CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Supertile.png", Status = true, Date = DateTime.Now, Modified = DateTime.Now, CategoryId = 1, }, new Product() { Id = 11, Name = "Item 11", CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-Sealant-HP.jpg", Status = true, Date = DateTime.Now, Modified = DateTime.Now, CategoryId = 2, }, new Product() { Id = 12, Name = "Item 12", CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-.jpg", Status = true, Date = DateTime.Now, Modified = DateTime.Now, CategoryId = 2, } ); } } }