コード例 #1
0
        public JsonPatchDocument <ApiShoppingCartItemRequestModel> CreatePatch(ApiShoppingCartItemRequestModel model)
        {
            var patch = new JsonPatchDocument <ApiShoppingCartItemRequestModel>();

            patch.Replace(x => x.DateCreated, model.DateCreated);
            patch.Replace(x => x.ModifiedDate, model.ModifiedDate);
            patch.Replace(x => x.ProductID, model.ProductID);
            patch.Replace(x => x.Quantity, model.Quantity);
            patch.Replace(x => x.ShoppingCartID, model.ShoppingCartID);
            return(patch);
        }
コード例 #2
0
        public virtual ApiShoppingCartItemRequestModel MapResponseToRequest(
            ApiShoppingCartItemResponseModel response)
        {
            var request = new ApiShoppingCartItemRequestModel();

            request.SetProperties(
                response.DateCreated,
                response.ModifiedDate,
                response.ProductID,
                response.Quantity,
                response.ShoppingCartID);
            return(request);
        }
コード例 #3
0
        public virtual ApiShoppingCartItemResponseModel MapRequestToResponse(
            int shoppingCartItemID,
            ApiShoppingCartItemRequestModel request)
        {
            var response = new ApiShoppingCartItemResponseModel();

            response.SetProperties(shoppingCartItemID,
                                   request.DateCreated,
                                   request.ModifiedDate,
                                   request.ProductID,
                                   request.Quantity,
                                   request.ShoppingCartID);
            return(response);
        }