예제 #1
0
        public JsonPatchDocument <ApiMessengerRequestModel> CreatePatch(ApiMessengerRequestModel model)
        {
            var patch = new JsonPatchDocument <ApiMessengerRequestModel>();

            patch.Replace(x => x.Date, model.Date);
            patch.Replace(x => x.FromUserId, model.FromUserId);
            patch.Replace(x => x.MessageId, model.MessageId);
            patch.Replace(x => x.Time, model.Time);
            patch.Replace(x => x.ToUserId, model.ToUserId);
            patch.Replace(x => x.UserId, model.UserId);
            return(patch);
        }
예제 #2
0
        public virtual ApiMessengerRequestModel MapResponseToRequest(
            ApiMessengerResponseModel response)
        {
            var request = new ApiMessengerRequestModel();

            request.SetProperties(
                response.Date,
                response.FromUserId,
                response.MessageId,
                response.Time,
                response.ToUserId,
                response.UserId);
            return(request);
        }
예제 #3
0
        public virtual ApiMessengerResponseModel MapRequestToResponse(
            int id,
            ApiMessengerRequestModel request)
        {
            var response = new ApiMessengerResponseModel();

            response.SetProperties(id,
                                   request.Date,
                                   request.FromUserId,
                                   request.MessageId,
                                   request.Time,
                                   request.ToUserId,
                                   request.UserId);
            return(response);
        }