예제 #1
0
        public Forum(Entity entity, IPortalViewEntity viewEntity, IForumInfo forumInfo, Func <ForumCounts> counts)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }
            if (viewEntity == null)
            {
                throw new ArgumentNullException("viewEntity");
            }
            if (forumInfo == null)
            {
                throw new ArgumentNullException("forumInfo");
            }
            if (counts == null)
            {
                throw new ArgumentNullException("counts");
            }

            Entity      = entity;
            _viewEntity = viewEntity;

            LatestPost = forumInfo.LatestPost;

            _counts = new Lazy <ForumCounts>(counts);

            Name        = entity.GetAttributeValue <string>("adx_name");
            Description = entity.GetAttributeValue <string>("adx_description");
        }
예제 #2
0
 public Forum(Entity entity, IPortalViewEntity viewEntity, IForumInfo forumInfo, ForumCounts counts)
     : this(entity, viewEntity, forumInfo, () => counts)
 {
 }