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
    }

}

 

转载于:https://www.cnblogs.com/shiningrise/p/5559960.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值