@@ -68,17 +68,15 @@ public ParseLiveQuerySubscription(IServiceHub serviceHub, string className, int
6868 /// This allows adjustments to the filter or watched keys without unsubscribing
6969 /// and re-subscribing.
7070 /// </summary>
71- /// <typeparam name="T ">The type of the ParseObject associated with the subscription.</typeparam>
71+ /// <typeparam name="T1 ">The type of the ParseObject associated with the subscription.</typeparam>
7272 /// <param name="liveQuery">The updated live query containing new parameters that
7373 /// will replace the existing ones for this subscription.</param>
7474 /// <param name="cancellationToken">A token to monitor for cancellation requests. If triggered,
7575 /// the update process will be halted.</param>
7676 /// <returns>A task that represents the asynchronous operation of updating
7777 /// the subscription with the new query parameters.</returns>
78- public async Task UpdateAsync < T > ( ParseLiveQuery < T > liveQuery , CancellationToken cancellationToken = default ) where T : ParseObject
79- {
78+ public async Task UpdateAsync < T1 > ( ParseLiveQuery < T1 > liveQuery , CancellationToken cancellationToken = default ) where T1 : ParseObject =>
8079 await Services . LiveQueryController . UpdateSubscriptionAsync ( liveQuery , RequestId , CancellationToken . None ) ;
81- }
8280
8381 /// <summary>
8482 /// Cancels the current live query subscription by unsubscribing from the Parse Live Query server.
@@ -87,10 +85,8 @@ public async Task UpdateAsync<T>(ParseLiveQuery<T> liveQuery, CancellationToken
8785 /// </summary>
8886 /// <param name="cancellationToken">A token to monitor for cancellation requests. If triggered, the cancellation process will halt.</param>
8987 /// <returns>A task that represents the asynchronous operation of canceling the subscription.</returns>
90- public async Task CancelAsync ( CancellationToken cancellationToken = default )
91- {
88+ public async Task CancelAsync ( CancellationToken cancellationToken = default ) =>
9289 await Services . LiveQueryController . UnsubscribeAsync ( RequestId , CancellationToken . None ) ;
93- }
9490
9591 /// <summary>
9692 /// Handles the creation event for an object that matches the subscription's query.
@@ -99,36 +95,30 @@ public async Task CancelAsync(CancellationToken cancellationToken = default)
9995 /// <param name="objectState">
10096 /// The state of the object that triggered the creation event, containing its data and metadata.
10197 /// </param>
102- public void OnCreate ( IObjectState objectState )
103- {
98+ public void OnCreate ( IObjectState objectState ) =>
10499 Create ? . Invoke ( this , new ParseLiveQueryEventArgs ( Services . GenerateObjectFromState < T > ( objectState , ClassName ) ) ) ;
105- }
106100
107101 /// <summary>
108102 /// Handles the event when an object enters the result set of a live query subscription. This occurs when an
109103 /// object begins to satisfy the query conditions.
110104 /// </summary>
111105 /// <param name="objectState">The current state of the object that has entered the query result set.</param>
112106 /// <param name="originalState">The original state of the object before entering the query result set.</param>
113- public void OnEnter ( IObjectState objectState , IObjectState originalState )
114- {
107+ public void OnEnter ( IObjectState objectState , IObjectState originalState ) =>
115108 Enter ? . Invoke ( this , new ParseLiveQueryDualEventArgs (
116109 Services . GenerateObjectFromState < T > ( objectState , ClassName ) ,
117110 Services . GenerateObjectFromState < T > ( originalState , ClassName ) ) ) ;
118- }
119111
120112 /// <summary>
121113 /// Handles the update event for objects subscribed to the Live Query. This method triggers the Update
122114 /// event, providing the updated object and its original state.
123115 /// </summary>
124116 /// <param name="objectState">The new state of the object after the update.</param>
125117 /// <param name="originalState">The original state of the object before the update.</param>
126- public void OnUpdate ( IObjectState objectState , IObjectState originalState )
127- {
118+ public void OnUpdate ( IObjectState objectState , IObjectState originalState ) =>
128119 Update ? . Invoke ( this , new ParseLiveQueryDualEventArgs (
129120 Services . GenerateObjectFromState < T > ( objectState , ClassName ) ,
130121 Services . GenerateObjectFromState < T > ( originalState , ClassName ) ) ) ;
131- }
132122
133123 /// <summary>
134124 /// Handles the event when an object leaves the result set of the live query subscription.
@@ -137,21 +127,17 @@ public void OnUpdate(IObjectState objectState, IObjectState originalState)
137127 /// </summary>
138128 /// <param name="objectState">The state of the object that left the result set.</param>
139129 /// <param name="originalState">The original state of the object before it left the result set.</param>
140- public void OnLeave ( IObjectState objectState , IObjectState originalState )
141- {
130+ public void OnLeave ( IObjectState objectState , IObjectState originalState ) =>
142131 Leave ? . Invoke ( this , new ParseLiveQueryDualEventArgs (
143132 Services . GenerateObjectFromState < T > ( objectState , ClassName ) ,
144133 Services . GenerateObjectFromState < T > ( originalState , ClassName ) ) ) ;
145- }
146134
147135 /// <summary>
148136 /// Handles the "delete" event for a live query subscription, triggered when an object is removed
149137 /// from the query's result set. This method processes the event by invoking the associated
150138 /// delete event handler, if subscribed, with the relevant object data.
151139 /// </summary>
152140 /// <param name="objectState">The state information of the object that was deleted.</param>
153- public void OnDelete ( IObjectState objectState )
154- {
141+ public void OnDelete ( IObjectState objectState ) =>
155142 Delete ? . Invoke ( this , new ParseLiveQueryEventArgs ( Services . GenerateObjectFromState < T > ( objectState , ClassName ) ) ) ;
156- }
157143}
0 commit comments