Exemplo n.º 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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        public virtual Post MapBOToEF(
            BOPost bo)
        {
            Post efPost = new Post();

            efPost.SetProperties(
                bo.AcceptedAnswerId,
                bo.AnswerCount,
                bo.Body,
                bo.ClosedDate,
                bo.CommentCount,
                bo.CommunityOwnedDate,
                bo.CreationDate,
                bo.FavoriteCount,
                bo.Id,
                bo.LastActivityDate,
                bo.LastEditDate,
                bo.LastEditorDisplayName,
                bo.LastEditorUserId,
                bo.OwnerUserId,
                bo.ParentId,
                bo.PostTypeId,
                bo.Score,
                bo.Tag,
                bo.Title,
                bo.ViewCount);
            return(efPost);
        }
Exemplo n.º 4
0
        public virtual ApiPostResponseModel MapBOToModel(
            BOPost boPost)
        {
            var model = new ApiPostResponseModel();

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

            return(model);
        }