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

            patch.Replace(x => x.Password, model.Password);
            patch.Replace(x => x.Username, model.Username);
            return(patch);
        }
Пример #2
0
        public virtual ApiUserRequestModel MapResponseToRequest(
            ApiUserResponseModel response)
        {
            var request = new ApiUserRequestModel();

            request.SetProperties(
                response.Password,
                response.Username);
            return(request);
        }
Пример #3
0
        public virtual ApiUserResponseModel MapRequestToResponse(
            int id,
            ApiUserRequestModel request)
        {
            var response = new ApiUserResponseModel();

            response.SetProperties(id,
                                   request.Password,
                                   request.Username);
            return(response);
        }