File tree Expand file tree Collapse file tree
ManagedCode.Communication/Result Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424 <RepositoryUrl >https://github.com/managedcode/Communication</RepositoryUrl >
2525 <PackageProjectUrl >https://github.com/managedcode/Communication</PackageProjectUrl >
2626 <Product >Managed Code - Communication</Product >
27- <Version >8.0.2 </Version >
28- <PackageVersion >8.0.2 </PackageVersion >
27+ <Version >8.0.3 </Version >
28+ <PackageVersion >8.0.3 </PackageVersion >
2929
3030 </PropertyGroup >
3131 <PropertyGroup Condition =" '$(GITHUB_ACTIONS)' == 'true'" >
Original file line number Diff line number Diff line change @@ -110,4 +110,24 @@ public static async Task<Result> From(Func<ValueTask> valueTask)
110110 return Fail ( Error . FromException ( e ) ) ;
111111 }
112112 }
113+
114+ public static Result From ( bool condition )
115+ {
116+ return condition ? Succeed ( ) : Fail ( ) ;
117+ }
118+
119+ public static Result From ( bool condition , Error error )
120+ {
121+ return condition ? Succeed ( ) : Fail ( error ) ;
122+ }
123+
124+ public static Result From ( Func < bool > condition )
125+ {
126+ return condition ( ) ? Succeed ( ) : Fail ( ) ;
127+ }
128+
129+ public static Result From ( Func < bool > condition , Error error )
130+ {
131+ return condition ( ) ? Succeed ( ) : Fail ( error ) ;
132+ }
113133}
You can’t perform that action at this time.
0 commit comments