Exemplo n.º 1
0
        public JsonPatchDocument <ApiMachinePolicyRequestModel> CreatePatch(ApiMachinePolicyRequestModel model)
        {
            var patch = new JsonPatchDocument <ApiMachinePolicyRequestModel>();

            patch.Replace(x => x.IsDefault, model.IsDefault);
            patch.Replace(x => x.JSON, model.JSON);
            patch.Replace(x => x.Name, model.Name);
            return(patch);
        }
Exemplo n.º 2
0
        public virtual ApiMachinePolicyRequestModel MapResponseToRequest(
            ApiMachinePolicyResponseModel response)
        {
            var request = new ApiMachinePolicyRequestModel();

            request.SetProperties(
                response.IsDefault,
                response.JSON,
                response.Name);
            return(request);
        }
Exemplo n.º 3
0
        public virtual ApiMachinePolicyResponseModel MapRequestToResponse(
            string id,
            ApiMachinePolicyRequestModel request)
        {
            var response = new ApiMachinePolicyResponseModel();

            response.SetProperties(id,
                                   request.IsDefault,
                                   request.JSON,
                                   request.Name);
            return(response);
        }