第一步添加实体
- 继承基类Basic
- 定义特性
namespace ZKCloud.CMS.Market.Domain.Entities { [ClassProperty("友情链接", AppName = "Common", Name = "友情链接", GroupName = "基本信息,高级选项", Icon = "fa-puzzle-piece", SortOrder = 1, Description = "设置以及查看系统的详细信息")] [SideBar(GroupName ="CMS",Name = "SideBar")] public class FriendlyLink : Basic { [Field("链接名称", ControlsType.TextBox, GroupTabId = 1,ListShow =true,SortOrder =10)] [Display(Name = "链接名称")] [Required(ErrorMessage = "链接名称不能为空")] public string Name { get; set; } [Field("网址", ControlsType.TextBox, GroupTabId = 1,ListShow =true,SortOrder =11)] [Display(Name = "网址")] [Required(ErrorMessage = "网址不能为空")] public string Url { get; set; } } public class FriendlyLinkCreator : IModelCreator { public void CreateModel(ModelBuilder builder) { builder.Entity<FriendlyLink>(d => { d.ToTable("CMS_FriendlyLink"); d.HasKey(e => e.Id); d.Property(e => e.Name).IsRequired(); }); } } }
第二步指定连接在何处显示
url格式:
列表页面:/Admin/Basic/Index?Key=ZKCloud.CMS.Market.Domain.Entities.FriendlyLink
编辑页面:/Admin/Basic/Edit?Key=ZKCloud.CMS.Market.Domain.Entities.FriendlyLink
时间: 2024-10-13 17:03:20