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); }
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); }
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); }