示例#1
0
        public virtual BOPost MapModelToBO(
            int id,
            ApiPostRequestModel model
            )
        {
            BOPost boPost = new BOPost();

            boPost.SetProperties(
                id,
                model.AcceptedAnswerId,
                model.AnswerCount,
                model.Body,
                model.ClosedDate,
                model.CommentCount,
                model.CommunityOwnedDate,
                model.CreationDate,
                model.FavoriteCount,
                model.LastActivityDate,
                model.LastEditDate,
                model.LastEditorDisplayName,
                model.LastEditorUserId,
                model.OwnerUserId,
                model.ParentId,
                model.PostTypeId,
                model.Score,
                model.Tag,
                model.Title,
                model.ViewCount);
            return(boPost);
        }
        public virtual BOPost MapEFToBO(
            Post ef)
        {
            var bo = new BOPost();

            bo.SetProperties(
                ef.Id,
                ef.AcceptedAnswerId,
                ef.AnswerCount,
                ef.Body,
                ef.ClosedDate,
                ef.CommentCount,
                ef.CommunityOwnedDate,
                ef.CreationDate,
                ef.FavoriteCount,
                ef.LastActivityDate,
                ef.LastEditDate,
                ef.LastEditorDisplayName,
                ef.LastEditorUserId,
                ef.OwnerUserId,
                ef.ParentId,
                ef.PostTypeId,
                ef.Score,
                ef.Tag,
                ef.Title,
                ef.ViewCount);
            return(bo);
        }