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

            patch.Replace(x => x.Name, model.Name);
            patch.Replace(x => x.Timestamp, model.Timestamp);
            return(patch);
        }
Пример #2
0
        public virtual ApiTimestampCheckRequestModel MapResponseToRequest(
            ApiTimestampCheckResponseModel response)
        {
            var request = new ApiTimestampCheckRequestModel();

            request.SetProperties(
                response.Name,
                response.Timestamp);
            return(request);
        }
Пример #3
0
        public virtual ApiTimestampCheckResponseModel MapRequestToResponse(
            int id,
            ApiTimestampCheckRequestModel request)
        {
            var response = new ApiTimestampCheckResponseModel();

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