Пример #1
0
        public JsonPatchDocument <ApiSubscriptionRequestModel> CreatePatch(ApiSubscriptionRequestModel model)
        {
            var patch = new JsonPatchDocument <ApiSubscriptionRequestModel>();

            patch.Replace(x => x.IsDisabled, model.IsDisabled);
            patch.Replace(x => x.JSON, model.JSON);
            patch.Replace(x => x.Name, model.Name);
            patch.Replace(x => x.Type, model.Type);
            return(patch);
        }
Пример #2
0
        public virtual ApiSubscriptionRequestModel MapResponseToRequest(
            ApiSubscriptionResponseModel response)
        {
            var request = new ApiSubscriptionRequestModel();

            request.SetProperties(
                response.IsDisabled,
                response.JSON,
                response.Name,
                response.Type);
            return(request);
        }
Пример #3
0
        public virtual ApiSubscriptionResponseModel MapRequestToResponse(
            string id,
            ApiSubscriptionRequestModel request)
        {
            var response = new ApiSubscriptionResponseModel();

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