-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathCmsCustomModelBuilder.cs
More file actions
29 lines (26 loc) · 1.77 KB
/
CmsCustomModelBuilder.cs
File metadata and controls
29 lines (26 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using Microsoft.EntityFrameworkCore;
using SimplCommerce.Infrastructure.Data;
using SimplCommerce.Module.Cms.Models;
using SimplCommerce.Module.Core.Models;
namespace SimplCommerce.Module.Cms.Data
{
public class CmsCustomModelBuilder : ICustomModelBuilder
{
public void Build(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Menu>().HasData(
new Menu(1) { Name = "Customer Services", IsPublished = true, IsSystem = true },
new Menu(2) { Name = "Information", IsPublished = true, IsSystem = true }
);
modelBuilder.Entity<EntityType>().HasData(
new EntityType("Page") { AreaName = "Cms", RoutingController = "Page", RoutingAction = "PageDetail", IsMenuable = true }
);
modelBuilder.Entity<Widget>().HasData(
new Widget("HtmlWidget") { Name = "Html Widget", ViewComponentName = "HtmlWidget", CreateUrl = "widget-html-create", EditUrl = "widget-html-edit", CreatedOn = new DateTimeOffset(new DateTime(2020, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)) },
new Widget("CarouselWidget") { Name = "Carousel Widget", ViewComponentName = "CarouselWidget", CreateUrl = "widget-carousel-create", EditUrl = "widget-carousel-edit", CreatedOn = new DateTimeOffset(new DateTime(2020, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)) },
new Widget("SpaceBarWidget") { Name = "SpaceBar Widget", ViewComponentName = "SpaceBarWidget", CreateUrl = "widget-spacebar-create", EditUrl = "widget-spacebar-edit", CreatedOn = new DateTimeOffset(new DateTime(2020, 5, 29, 4, 33, 39, 164, DateTimeKind.Unspecified), new TimeSpan(0, 7, 0, 0, 0)) }
);
}
}
}