Beispiel #1
0
        public JsonPatchDocument <ApiNuGetPackageRequestModel> CreatePatch(ApiNuGetPackageRequestModel model)
        {
            var patch = new JsonPatchDocument <ApiNuGetPackageRequestModel>();

            patch.Replace(x => x.JSON, model.JSON);
            patch.Replace(x => x.PackageId, model.PackageId);
            patch.Replace(x => x.Version, model.Version);
            patch.Replace(x => x.VersionBuild, model.VersionBuild);
            patch.Replace(x => x.VersionMajor, model.VersionMajor);
            patch.Replace(x => x.VersionMinor, model.VersionMinor);
            patch.Replace(x => x.VersionRevision, model.VersionRevision);
            patch.Replace(x => x.VersionSpecial, model.VersionSpecial);
            return(patch);
        }
Beispiel #2
0
        public virtual ApiNuGetPackageRequestModel MapResponseToRequest(
            ApiNuGetPackageResponseModel response)
        {
            var request = new ApiNuGetPackageRequestModel();

            request.SetProperties(
                response.JSON,
                response.PackageId,
                response.Version,
                response.VersionBuild,
                response.VersionMajor,
                response.VersionMinor,
                response.VersionRevision,
                response.VersionSpecial);
            return(request);
        }
Beispiel #3
0
        public virtual ApiNuGetPackageResponseModel MapRequestToResponse(
            string id,
            ApiNuGetPackageRequestModel request)
        {
            var response = new ApiNuGetPackageResponseModel();

            response.SetProperties(id,
                                   request.JSON,
                                   request.PackageId,
                                   request.Version,
                                   request.VersionBuild,
                                   request.VersionMajor,
                                   request.VersionMinor,
                                   request.VersionRevision,
                                   request.VersionSpecial);
            return(response);
        }