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

            patch.Replace(x => x.ApiKeyHashed, model.ApiKeyHashed);
            patch.Replace(x => x.Created, model.Created);
            patch.Replace(x => x.JSON, model.JSON);
            patch.Replace(x => x.UserId, model.UserId);
            return(patch);
        }
Пример #2
0
        public virtual ApiApiKeyRequestModel MapResponseToRequest(
            ApiApiKeyResponseModel response)
        {
            var request = new ApiApiKeyRequestModel();

            request.SetProperties(
                response.ApiKeyHashed,
                response.Created,
                response.JSON,
                response.UserId);
            return(request);
        }
Пример #3
0
        public virtual ApiApiKeyResponseModel MapRequestToResponse(
            string id,
            ApiApiKeyRequestModel request)
        {
            var response = new ApiApiKeyResponseModel();

            response.SetProperties(id,
                                   request.ApiKeyHashed,
                                   request.Created,
                                   request.JSON,
                                   request.UserId);
            return(response);
        }