src/ZKEACMS.SectionWidget/Models/SectionGroup.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/* http://www.zkea.net/ 
 * Copyright (c) ZKEASOFT. All rights reserved. 
 * http://www.zkea.net/licenses */

using System;
using System.Collections.Generic;
using System.Linq;
using ZKEACMS.SectionWidget.Service;
using Easy.Extend;
using Easy.MetaData;
using Easy.Models;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.Extensions.DependencyInjection;
using System.ComponentModel.DataAnnotations;
using Easy;
using Easy.RepositoryPattern;

namespace ZKEACMS.SectionWidget.Models
{
    [DataTable("SectionGroup")]
    public class SectionGroup : EditorEntity
    {
        [Key]
        public string ID { get; set; }
        public string GroupName { get; set; }
        public string SectionWidgetId { get; set; }
        public string PartialView { get; set; }
        public int? Order { get; set; }
        public string PercentWidth { get; set; }
        [NotMapped]
        public bool IsLoadDefaultData { get; set; }
        [NotMapped]
        public IEnumerable<SectionContent> SectionContents { get; set; }

        private T GetContent<T>(SectionContentBase.Types type) where T : SectionContent
        {
            if (SectionContents != null)
            {
                return SectionContents.FirstOrDefault(m => m != null && m.SectionContentType == (int)type) as T;
            }
            return null;
        }

        private IEnumerable<T> GetContents<T>(SectionContentBase.Types type) where T : SectionContent
        {
            if (SectionContents != null)
            {
                return SectionContents.Where(m => m != null && m.SectionContentType == (int)type).OrderBy(m => m.Order).Cast<T>();
            }
            return null;
        }
        [NotMapped]
        public SectionContentTitle SectionTitle
        {
            get
            {
                return GetContent<SectionContentTitle>(SectionContentBase.Types.Title);
            }
        }
        [NotMapped]
后面还有 95 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。