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
    }

}
复制代码

 

posted @   shiningrise  阅读(301)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2014-06-05 zencart资源
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css
点击右上角即可分享
微信分享提示