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

            patch.Replace(x => x.Date, model.Date);
            patch.Replace(x => x.Name, model.Name);
            patch.Replace(x => x.UserId, model.UserId);
            return(patch);
        }
Example #2
0
        public virtual ApiBadgeRequestModel MapResponseToRequest(
            ApiBadgeResponseModel response)
        {
            var request = new ApiBadgeRequestModel();

            request.SetProperties(
                response.Date,
                response.Name,
                response.UserId);
            return(request);
        }
Example #3
0
        public virtual ApiBadgeResponseModel MapRequestToResponse(
            int id,
            ApiBadgeRequestModel request)
        {
            var response = new ApiBadgeResponseModel();

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