File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,6 @@ public ServiceResult WithMetadata(string key, string value)
129129 /// A <see cref="ServiceResult"/> instance representing the success or error state.
130130 /// </returns>
131131 public static implicit operator ServiceResult ( bool isSuccess ) => isSuccess ? Ok ( ) : Error ( ) ;
132-
133132}
134133
135134/// <summary>
@@ -205,8 +204,12 @@ public class ServiceResult<TData> : ServiceResult
205204 /// Implicitly converts data of type <typeparamref name="TData"/> into a <see cref="ServiceResult{TData}"/> representing a successful result.
206205 /// </summary>
207206 /// <param name="data">The data to wrap in a <see cref="ServiceResult{TData}"/>.</param>
208- public static implicit operator ServiceResult < TData > ( TData ? data ) => new ( ) { Data = data } ;
209-
207+ public static implicit operator ServiceResult < TData > ( TData ? data ) => new ( )
208+ {
209+ Success = true ,
210+ Data = data
211+ } ;
212+
210213 /// <summary>
211214 /// Unwraps the data contained in the result, throwing an exception if the result is unsuccessful or the data is null.
212215 /// </summary>
You can’t perform that action at this time.
0 commit comments