Esempio n. 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);
        }
Esempio n. 2
0
        public virtual ApiApiKeyRequestModel MapResponseToRequest(
            ApiApiKeyResponseModel response)
        {
            var request = new ApiApiKeyRequestModel();

            request.SetProperties(
                response.ApiKeyHashed,
                response.Created,
                response.JSON,
                response.UserId);
            return(request);
        }
Esempio n. 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);
        }