• PageBase


    namespace Webform.App
    {
        public class PageBase : System.Web.UI.Page
        {
        }
    
        public interface IService<TEntity, TKey> : IRepository<TEntity, TKey>, IScopeDependency
            where TEntity : IEntity<TKey>
        {
    
        }
        public class ServiceBase<TEntity, TKey> : Repository<TEntity, TKey>
            where TEntity : class, IEntity<TKey>
        {
            public ServiceBase(IDbContextTypeResolver contextTypeResolver) : base(contextTypeResolver)
            {
            }
    
            public IDbContextTypeResolver ContextTypeResolver { get; set; }
        }
    
        public abstract class ListPageBase<TEntity, TKey> : PageBase
            where TEntity : class, IEntity<TKey>
        {
            public ServiceBase<TEntity, TKey> Service { get; set; }
    
            public List<TEntity> List()
            {
                return this.Service.Entities.ToList();
            }
        }
    
    
        public class Atricle : EntityBase<Guid>, IAudited
        {
            public Atricle()
            {
            }
    
            /// <summary>
            /// 获取或设置 文章标题
            /// </summary>
            [Required, StringLength(100)]
            public string Title { get; set; }
    
            /// <summary>
            /// 获取或设置 文章内容
            /// </summary>
            public string Content { get; set; }
    
            #region Implementation of ICreatedTime
    
            /// <summary>
            /// 获取设置 信息创建时间
            /// </summary>
            public DateTime CreatedTime { get; set; }
    
            #endregion
    
            #region Implementation of ICreatedAudited
    
            /// <summary>
            /// 获取或设置 创建者编号
            /// </summary>
            [StringLength(50)]
            public string CreatorUserId { get; set; }
    
            #endregion
    
            #region Implementation of IUpdateAutited
    
            /// <summary>
            /// 获取或设置 最后更新时间
            /// </summary>
            public DateTime? LastUpdatedTime { get; set; }
    
            /// <summary>
            /// 获取或设置 最后更新者编号
            /// </summary>
            [StringLength(50)]
            public string LastUpdatorUserId { get; set; }
    
            #endregion
        }
    
    }
  • 相关阅读:
    MYSQL删除表的记录后如何使ID从1开始
    Python chardet 字符编码判断
    中文搜索引擎技术揭密
    python 处理中文网页时,忽略特殊字符,忽略异常
    cmd 之基础命令
    自己写的删除主键的存储过程
    朝花夕拾delphi的三层结构
    ERWIN中的一对多标识关系和一对多非标识关系
    翻页用的SQL
    关于 Ajax 的一篇通俗易懂的文章
  • 原文地址:https://www.cnblogs.com/shiningrise/p/5559960.html
Copyright © 2020-2023  润新知