Repository navigation
Expand file tree
/
Copy pathindex.json
More file actions
367 lines (367 loc) · 178 KB
/
Copy pathindex.json
File metadata and controls
367 lines (367 loc) · 178 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
{
"api/Recore.AbsoluteUri.html": {
"href": "api/Recore.AbsoluteUri.html",
"title": "Class AbsoluteUri | RecoreFX",
"keywords": "Class AbsoluteUri Represents an absolute URI. Inheritance Object Uri AbsoluteUri Implements ISerializable Inherited Members Uri.SchemeDelimiter Uri.UriSchemeFile Uri.UriSchemeFtp Uri.UriSchemeGopher Uri.UriSchemeHttp Uri.UriSchemeHttps Uri.UriSchemeMailto Uri.UriSchemeNetPipe Uri.UriSchemeNetTcp Uri.UriSchemeNews Uri.UriSchemeNntp Uri.Canonicalize() Uri.CheckHostName(String) Uri.CheckSchemeName(String) Uri.CheckSecurity() Uri.Compare(Uri, Uri, UriComponents, UriFormat, StringComparison) Uri.Equals(Object) Uri.Escape() Uri.EscapeDataString(String) Uri.EscapeString(String) Uri.EscapeUriString(String) Uri.FromHex(Char) Uri.GetComponents(UriComponents, UriFormat) Uri.GetHashCode() Uri.GetLeftPart(UriPartial) Uri.GetObjectData(SerializationInfo, StreamingContext) Uri.HexEscape(Char) Uri.HexUnescape(String, Int32) Uri.IsBadFileSystemCharacter(Char) Uri.IsBaseOf(Uri) Uri.IsExcludedCharacter(Char) Uri.IsHexDigit(Char) Uri.IsHexEncoding(String, Int32) Uri.IsReservedCharacter(Char) Uri.IsWellFormedOriginalString() Uri.IsWellFormedUriString(String, UriKind) Uri.MakeRelative(Uri) Uri.MakeRelativeUri(Uri) Uri.Parse() Uri.ISerializable.GetObjectData(SerializationInfo, StreamingContext) Uri.ToString() Uri.TryCreate(String, UriKind, Uri) Uri.TryCreate(Uri, String, Uri) Uri.TryCreate(Uri, Uri, Uri) Uri.Unescape(String) Uri.UnescapeDataString(String) Uri.AbsolutePath Uri.AbsoluteUri Uri.Authority Uri.DnsSafeHost Uri.Fragment Uri.Host Uri.HostNameType Uri.IdnHost Uri.IsAbsoluteUri Uri.IsDefaultPort Uri.IsFile Uri.IsLoopback Uri.IsUnc Uri.LocalPath Uri.OriginalString Uri.PathAndQuery Uri.Port Uri.Query Uri.Scheme Uri.Segments Uri.UserEscaped Uri.UserInfo Object.Equals(Object, Object) Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Recore Assembly : Recore.dll Syntax [JsonConverter(typeof(AbsoluteUriConverter))] public class AbsoluteUri : Uri, ISerializable Constructors | Improve this Doc View Source AbsoluteUri(String) Initializes a new instance of AbsoluteUri with the given URI. Declaration public AbsoluteUri(string uriString) Parameters Type Name Description String uriString Methods | Improve this Doc View Source Combine(RelativeUri) Appends a relative URI to an absolute URI. Declaration public AbsoluteUri Combine(RelativeUri relativeUri) Parameters Type Name Description RelativeUri relativeUri Returns Type Description AbsoluteUri | Improve this Doc View Source Combine(String) Appends a relative URI to an absolute URI. Declaration public AbsoluteUri Combine(string relativeUri) Parameters Type Name Description String relativeUri Returns Type Description AbsoluteUri | Improve this Doc View Source TryCreate(String, out AbsoluteUri) Creates a new AbsoluteUri . Does not throw an exception if the AbsoluteUri cannot be created. Declaration public static bool TryCreate(string uriString, out AbsoluteUri result) Parameters Type Name Description String uriString AbsoluteUri result Returns Type Description Boolean Implements System.Runtime.Serialization.ISerializable Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>) UriExtensions.AsAbsoluteUri(Uri) UriExtensions.AsRelativeUri(Uri)"
},
"api/Recore.AsyncAction.html": {
"href": "api/Recore.AsyncAction.html",
"title": "Delegate AsyncAction | RecoreFX",
"keywords": "Delegate AsyncAction Encapsulates an asynchronous method that has no parameters and does not return a value. Equivalent to Func<Task> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task AsyncAction(); Returns Type Description Task Examples Say you have a method with the signature Task DoThing(int x, string s, Func<Task> thing) You can refactor this to Task DoThing(int x, string s, AsyncAction thing) Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncAction-1.html": {
"href": "api/Recore.AsyncAction-1.html",
"title": "Delegate AsyncAction<T> | RecoreFX",
"keywords": "Delegate AsyncAction<T> Encapsulates an asynchronous method that has one parameter and does not return a value. Equivalent to Func<T, Task> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task AsyncAction<in T>(T obj); Parameters Type Name Description T obj Returns Type Description Task Type Parameters Name Description T Examples Say you have a method with the signature Task DoThing(int x, string s, Func<int, Task> thing) You can refactor this to Task DoThing(int x, string s, AsyncAction<int> thing) Extension Methods Func.AsyncFluent<T>(AsyncAction<T>) ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncAction-10.html": {
"href": "api/Recore.AsyncAction-10.html",
"title": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> | RecoreFX",
"keywords": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Encapsulates an asynchronous method that has 10 parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, Task> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task AsyncAction<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 T8 arg8 T9 arg9 T10 arg10 Returns Type Description Task Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncAction-11.html": {
"href": "api/Recore.AsyncAction-11.html",
"title": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> | RecoreFX",
"keywords": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Encapsulates an asynchronous method that has 11 parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, Task> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task AsyncAction<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 T8 arg8 T9 arg9 T10 arg10 T11 arg11 Returns Type Description Task Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncAction-12.html": {
"href": "api/Recore.AsyncAction-12.html",
"title": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> | RecoreFX",
"keywords": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Encapsulates an asynchronous method that has 12 parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, Task> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task AsyncAction<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 T8 arg8 T9 arg9 T10 arg10 T11 arg11 T12 arg12 Returns Type Description Task Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncAction-13.html": {
"href": "api/Recore.AsyncAction-13.html",
"title": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> | RecoreFX",
"keywords": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Encapsulates an asynchronous method that has 13 parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Task> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task AsyncAction<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 T8 arg8 T9 arg9 T10 arg10 T11 arg11 T12 arg12 T13 arg13 Returns Type Description Task Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncAction-14.html": {
"href": "api/Recore.AsyncAction-14.html",
"title": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> | RecoreFX",
"keywords": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Encapsulates an asynchronous method that has 14 parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, Task> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task AsyncAction<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 T8 arg8 T9 arg9 T10 arg10 T11 arg11 T12 arg12 T13 arg13 T14 arg14 Returns Type Description Task Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncAction-15.html": {
"href": "api/Recore.AsyncAction-15.html",
"title": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> | RecoreFX",
"keywords": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Encapsulates an asynchronous method that has 15 parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, Task> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task AsyncAction<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14, in T15>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 T8 arg8 T9 arg9 T10 arg10 T11 arg11 T12 arg12 T13 arg13 T14 arg14 T15 arg15 Returns Type Description Task Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 T15 Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncAction-16.html": {
"href": "api/Recore.AsyncAction-16.html",
"title": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> | RecoreFX",
"keywords": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Encapsulates an asynchronous method that has 16 parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, Task> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task AsyncAction<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14, in T15, in T16>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 T8 arg8 T9 arg9 T10 arg10 T11 arg11 T12 arg12 T13 arg13 T14 arg14 T15 arg15 T16 arg16 Returns Type Description Task Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 T15 T16 Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncAction-2.html": {
"href": "api/Recore.AsyncAction-2.html",
"title": "Delegate AsyncAction<T1, T2> | RecoreFX",
"keywords": "Delegate AsyncAction<T1, T2> Encapsulates an asynchronous method that has two parameters and does not return a value. Equivalent to Func<T1, T2, Task> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task AsyncAction<in T1, in T2>(T1 arg1, T2 arg2); Parameters Type Name Description T1 arg1 T2 arg2 Returns Type Description Task Type Parameters Name Description T1 T2 Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncAction-3.html": {
"href": "api/Recore.AsyncAction-3.html",
"title": "Delegate AsyncAction<T1, T2, T3> | RecoreFX",
"keywords": "Delegate AsyncAction<T1, T2, T3> Encapsulates an asynchronous method that has three parameters and does not return a value. Equivalent to Func<T1, T2, T3, Task> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task AsyncAction<in T1, in T2, in T3>(T1 arg1, T2 arg2, T3 arg3); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 Returns Type Description Task Type Parameters Name Description T1 T2 T3 Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncAction-4.html": {
"href": "api/Recore.AsyncAction-4.html",
"title": "Delegate AsyncAction<T1, T2, T3, T4> | RecoreFX",
"keywords": "Delegate AsyncAction<T1, T2, T3, T4> Encapsulates an asynchronous method that has four parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, Task> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task AsyncAction<in T1, in T2, in T3, in T4>(T1 arg1, T2 arg2, T3 arg3, T4 arg4); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 Returns Type Description Task Type Parameters Name Description T1 T2 T3 T4 Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncAction-5.html": {
"href": "api/Recore.AsyncAction-5.html",
"title": "Delegate AsyncAction<T1, T2, T3, T4, T5> | RecoreFX",
"keywords": "Delegate AsyncAction<T1, T2, T3, T4, T5> Encapsulates an asynchronous method that has five parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, Task> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task AsyncAction<in T1, in T2, in T3, in T4, in T5>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 Returns Type Description Task Type Parameters Name Description T1 T2 T3 T4 T5 Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncAction-6.html": {
"href": "api/Recore.AsyncAction-6.html",
"title": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6> | RecoreFX",
"keywords": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6> Encapsulates an asynchronous method that has six parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, Task> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task AsyncAction<in T1, in T2, in T3, in T4, in T5, in T6>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 Returns Type Description Task Type Parameters Name Description T1 T2 T3 T4 T5 T6 Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncAction-7.html": {
"href": "api/Recore.AsyncAction-7.html",
"title": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7> | RecoreFX",
"keywords": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7> Encapsulates an asynchronous method that has seven parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, Task> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task AsyncAction<in T1, in T2, in T3, in T4, in T5, in T6, in T7>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 Returns Type Description Task Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncAction-8.html": {
"href": "api/Recore.AsyncAction-8.html",
"title": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8> | RecoreFX",
"keywords": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8> Encapsulates an asynchronous method that has eight parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, Task> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task AsyncAction<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 T8 arg8 Returns Type Description Task Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 T8 Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncAction-9.html": {
"href": "api/Recore.AsyncAction-9.html",
"title": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9> | RecoreFX",
"keywords": "Delegate AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9> Encapsulates an asynchronous method that has nine parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, Task> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task AsyncAction<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 T8 arg8 T9 arg9 Returns Type Description Task Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 T8 T9 Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncDefer.html": {
"href": "api/Recore.AsyncDefer.html",
"title": "Class AsyncDefer | RecoreFX",
"keywords": "Class AsyncDefer Invokes an asynchronous action when disposed. Inheritance Object AsyncDefer Implements IAsyncDisposable Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore Assembly : Recore.dll Syntax public sealed class AsyncDefer : IAsyncDisposable Remarks Not thread-safe. Concurrent calls to dispose the object may result in the action being invoked multiple times. However, sequential calls to DisposeAsync() are idempotent. If an instance of this type is created and never disposed, the callback will not be called. By design, the callback is not called from the finalizer, which would happen non-determinstically. Constructors | Improve this Doc View Source AsyncDefer(AsyncAction) Initializes an object with an action to invoke when the object is disposed. Declaration public AsyncDefer(AsyncAction action) Parameters Type Name Description AsyncAction action Methods | Improve this Doc View Source DisposeAsync() Invokes the callback registered with the object and marks the object as disposed. Declaration public ValueTask DisposeAsync() Returns Type Description ValueTask Implements System.IAsyncDisposable Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncFunc-1.html": {
"href": "api/Recore.AsyncFunc-1.html",
"title": "Delegate AsyncFunc<TResult> | RecoreFX",
"keywords": "Delegate AsyncFunc<TResult> Encapsulates an asynchronous method that has no parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<Task<TResult>> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task<TResult> AsyncFunc<TResult>(); Returns Type Description Task <TResult> Type Parameters Name Description TResult Examples Say you have a method with the signature Task DoThing(int x, string s, Func<Task<string>> thing) You can refactor this to Task DoThing(int x, string s, AsyncFunc<string> thing) Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncFunc-10.html": {
"href": "api/Recore.AsyncFunc-10.html",
"title": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult> | RecoreFX",
"keywords": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult> Encapsulates an asynchronous method that has nine parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, Task<TResult>> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task<TResult> AsyncFunc<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 T8 arg8 T9 arg9 Returns Type Description Task <TResult> Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 T8 T9 TResult Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncFunc-11.html": {
"href": "api/Recore.AsyncFunc-11.html",
"title": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult> | RecoreFX",
"keywords": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult> Encapsulates an asynchronous method that has 10 parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, Task<TResult>> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task<TResult> AsyncFunc<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 T8 arg8 T9 arg9 T10 arg10 Returns Type Description Task <TResult> Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 TResult Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncFunc-12.html": {
"href": "api/Recore.AsyncFunc-12.html",
"title": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult> | RecoreFX",
"keywords": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult> Encapsulates an asynchronous method that has 11 parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, Task<TResult>> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task<TResult> AsyncFunc<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 T8 arg8 T9 arg9 T10 arg10 T11 arg11 Returns Type Description Task <TResult> Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 TResult Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncFunc-13.html": {
"href": "api/Recore.AsyncFunc-13.html",
"title": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult> | RecoreFX",
"keywords": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult> Encapsulates an asynchronous method that has 12 parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, Task<TResult>> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task<TResult> AsyncFunc<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 T8 arg8 T9 arg9 T10 arg10 T11 arg11 T12 arg12 Returns Type Description Task <TResult> Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 TResult Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncFunc-14.html": {
"href": "api/Recore.AsyncFunc-14.html",
"title": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult> | RecoreFX",
"keywords": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult> Encapsulates an asynchronous method that has 13 parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Task<TResult>> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task<TResult> AsyncFunc<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 T8 arg8 T9 arg9 T10 arg10 T11 arg11 T12 arg12 T13 arg13 Returns Type Description Task <TResult> Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 TResult Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncFunc-15.html": {
"href": "api/Recore.AsyncFunc-15.html",
"title": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult> | RecoreFX",
"keywords": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult> Encapsulates an asynchronous method that has 14 parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, Task<TResult>> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task<TResult> AsyncFunc<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14, TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 T8 arg8 T9 arg9 T10 arg10 T11 arg11 T12 arg12 T13 arg13 T14 arg14 Returns Type Description Task <TResult> Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 TResult Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncFunc-16.html": {
"href": "api/Recore.AsyncFunc-16.html",
"title": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult> | RecoreFX",
"keywords": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult> Encapsulates an asynchronous method that has 15 parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, Task<TResult>> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task<TResult> AsyncFunc<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14, in T15, TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 T8 arg8 T9 arg9 T10 arg10 T11 arg11 T12 arg12 T13 arg13 T14 arg14 T15 arg15 Returns Type Description Task <TResult> Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 T15 TResult Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncFunc-17.html": {
"href": "api/Recore.AsyncFunc-17.html",
"title": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult> | RecoreFX",
"keywords": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult> Encapsulates an asynchronous method that has 16 parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, Task<TResult>> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task<TResult> AsyncFunc<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14, in T15, in T16, TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 T8 arg8 T9 arg9 T10 arg10 T11 arg11 T12 arg12 T13 arg13 T14 arg14 T15 arg15 T16 arg16 Returns Type Description Task <TResult> Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 T15 T16 TResult Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncFunc-2.html": {
"href": "api/Recore.AsyncFunc-2.html",
"title": "Delegate AsyncFunc<T, TResult> | RecoreFX",
"keywords": "Delegate AsyncFunc<T, TResult> Encapsulates an asynchronous method that has one parameter and returns a value of the type specified by the TResult parameter. Equivalent to Func<Task<TResult>> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task<TResult> AsyncFunc<in T, TResult>(T obj); Parameters Type Name Description T obj Returns Type Description Task <TResult> Type Parameters Name Description T TResult Examples Say you have a method with the signature Task DoThing(int x, string s, Func<int, Task<string>> thing) You can refactor this to Task DoThing(int x, string s, AsyncFunc<int, string> thing) Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncFunc-3.html": {
"href": "api/Recore.AsyncFunc-3.html",
"title": "Delegate AsyncFunc<T1, T2, TResult> | RecoreFX",
"keywords": "Delegate AsyncFunc<T1, T2, TResult> Encapsulates an asynchronous method that has two parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, Task<TResult>> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task<TResult> AsyncFunc<in T1, in T2, TResult>(T1 arg1, T2 arg2); Parameters Type Name Description T1 arg1 T2 arg2 Returns Type Description Task <TResult> Type Parameters Name Description T1 T2 TResult Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncFunc-4.html": {
"href": "api/Recore.AsyncFunc-4.html",
"title": "Delegate AsyncFunc<T1, T2, T3, TResult> | RecoreFX",
"keywords": "Delegate AsyncFunc<T1, T2, T3, TResult> Encapsulates an asynchronous method that has three parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, Task<TResult>> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task<TResult> AsyncFunc<in T1, in T2, in T3, TResult>(T1 arg1, T2 arg2, T3 arg3); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 Returns Type Description Task <TResult> Type Parameters Name Description T1 T2 T3 TResult Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncFunc-5.html": {
"href": "api/Recore.AsyncFunc-5.html",
"title": "Delegate AsyncFunc<T1, T2, T3, T4, TResult> | RecoreFX",
"keywords": "Delegate AsyncFunc<T1, T2, T3, T4, TResult> Encapsulates an asynchronous method that has four parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, Task<TResult>> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task<TResult> AsyncFunc<in T1, in T2, in T3, in T4, TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 Returns Type Description Task <TResult> Type Parameters Name Description T1 T2 T3 T4 TResult Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncFunc-6.html": {
"href": "api/Recore.AsyncFunc-6.html",
"title": "Delegate AsyncFunc<T1, T2, T3, T4, T5, TResult> | RecoreFX",
"keywords": "Delegate AsyncFunc<T1, T2, T3, T4, T5, TResult> Encapsulates an asynchronous method that has five parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, Task<TResult>> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task<TResult> AsyncFunc<in T1, in T2, in T3, in T4, in T5, TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 Returns Type Description Task <TResult> Type Parameters Name Description T1 T2 T3 T4 T5 TResult Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncFunc-7.html": {
"href": "api/Recore.AsyncFunc-7.html",
"title": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, TResult> | RecoreFX",
"keywords": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, TResult> Encapsulates an asynchronous method that has six parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, Task<TResult>> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task<TResult> AsyncFunc<in T1, in T2, in T3, in T4, in T5, in T6, TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 Returns Type Description Task <TResult> Type Parameters Name Description T1 T2 T3 T4 T5 T6 TResult Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncFunc-8.html": {
"href": "api/Recore.AsyncFunc-8.html",
"title": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, TResult> | RecoreFX",
"keywords": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, TResult> Encapsulates an asynchronous method that has seven parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, Task<TResult>> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task<TResult> AsyncFunc<in T1, in T2, in T3, in T4, in T5, in T6, in T7, TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 Returns Type Description Task <TResult> Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 TResult Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.AsyncFunc-9.html": {
"href": "api/Recore.AsyncFunc-9.html",
"title": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, TResult> | RecoreFX",
"keywords": "Delegate AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, TResult> Encapsulates an asynchronous method that has eight parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, Task<TResult>> . Namespace : Recore Assembly : Recore.dll Syntax public delegate Task<TResult> AsyncFunc<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8); Parameters Type Name Description T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 T6 arg6 T7 arg7 T8 arg8 Returns Type Description Task <TResult> Type Parameters Name Description T1 T2 T3 T4 T5 T6 T7 T8 TResult Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.Collections.Generic.AnonymousEqualityComparer-1.html": {
"href": "api/Recore.Collections.Generic.AnonymousEqualityComparer-1.html",
"title": "Class AnonymousEqualityComparer<T> | RecoreFX",
"keywords": "Class AnonymousEqualityComparer<T> Compares instances of a type using the given equality function. Inheritance Object AnonymousEqualityComparer<T> Implements IEqualityComparer <T> Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore.Collections.Generic Assembly : Recore.dll Syntax public sealed class AnonymousEqualityComparer<T> : IEqualityComparer<T> Type Parameters Name Description T Remarks Note that there is no corresponding AnonymousComparer<T> type for IComparer<T> . That use case is already filled by Create(Comparison<T>) . Constructors | Improve this Doc View Source AnonymousEqualityComparer(Func<T, T, Boolean>, Func<T, Int32>) Creates an instance of AnonymousEqualityComparer<T> . Declaration public AnonymousEqualityComparer(Func<T, T, bool> equals, Func<T, int> getHashCode) Parameters Type Name Description Func <T, T, Boolean > equals Func <T, Int32 > getHashCode Methods | Improve this Doc View Source Equals(T, T) Invokes the given comparison function on two objects. Declaration public bool Equals(T x, T y) Parameters Type Name Description T x T y Returns Type Description Boolean | Improve this Doc View Source GetHashCode(T) Invokes the given hashing function on an object. Declaration public int GetHashCode(T obj) Parameters Type Name Description T obj Returns Type Description Int32 Implements System.Collections.Generic.IEqualityComparer<T> Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.Collections.Generic.html": {
"href": "api/Recore.Collections.Generic.html",
"title": "Namespace Recore.Collections.Generic | RecoreFX",
"keywords": "Namespace Recore.Collections.Generic Classes AnonymousEqualityComparer<T> Compares instances of a type using the given equality function. ICollectionExtensions Provides additional methods for working with ICollection<T> . IDictionaryExtensions Provides additional methods for working with IDictionary<TKey,TValue> . Iterator Provides helper methods for working with IIterator<T> . LinkedListExtensions Provides additional methods for working with LinkedList<T> . ListExtensions Provides additional methods for working with List<T> . MappedComparer<T, TMapped> Compares instances of a type based on the output of a mapping function. MappedEqualityComparer<T, TMapped> Compares instances of a type based on the output of a mapping function. Interfaces IIterator<T> An alternative interface to IEnumerator<T> that provides access to a sequence of elements."
},
"api/Recore.Collections.Generic.ICollectionExtensions.html": {
"href": "api/Recore.Collections.Generic.ICollectionExtensions.html",
"title": "Class ICollectionExtensions | RecoreFX",
"keywords": "Class ICollectionExtensions Provides additional methods for working with ICollection<T> . Inheritance Object ICollectionExtensions Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore.Collections.Generic Assembly : Recore.dll Syntax public static class ICollectionExtensions Methods | Improve this Doc View Source Append<T>(ICollection<T>, T) Adds an item to the collection and passes the collection through. Declaration public static ICollection<T> Append<T>(this ICollection<T> collection, T item) Parameters Type Name Description ICollection <T> collection T item Returns Type Description ICollection <T> Type Parameters Name Description T"
},
"api/Recore.Collections.Generic.IDictionaryExtensions.html": {
"href": "api/Recore.Collections.Generic.IDictionaryExtensions.html",
"title": "Class IDictionaryExtensions | RecoreFX",
"keywords": "Class IDictionaryExtensions Provides additional methods for working with IDictionary<TKey,TValue> . Inheritance Object IDictionaryExtensions Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore.Collections.Generic Assembly : Recore.dll Syntax public static class IDictionaryExtensions Methods | Improve this Doc View Source AddRange<TKey, TValue>(IDictionary<TKey, TValue>, IEnumerable<KeyValuePair<TKey, TValue>>) Adds all elements of the specified collection to the IDictionary<TKey,TValue> . Existing elements are overwritten if there are duplicates. Declaration public static void AddRange<TKey, TValue>(this IDictionary<TKey, TValue> dict, IEnumerable<KeyValuePair<TKey, TValue>> collection) Parameters Type Name Description IDictionary <TKey, TValue> dict IEnumerable < KeyValuePair <TKey, TValue>> collection Type Parameters Name Description TKey TValue | Improve this Doc View Source Append<TKey, TValue>(IDictionary<TKey, TValue>, TKey, TValue) Adds an entry to the IDictionary<TKey,TValue> and passes the dictionary through. Declaration public static IDictionary<TKey, TValue> Append<TKey, TValue>(this IDictionary<TKey, TValue> dict, TKey key, TValue value) Parameters Type Name Description IDictionary <TKey, TValue> dict TKey key TValue value Returns Type Description IDictionary <TKey, TValue> Type Parameters Name Description TKey TValue | Improve this Doc View Source GetOrAdd<TKey, TValue>(IDictionary<TKey, TValue>, TKey, TValue) Adds a key/value pair to the IDictionary<TKey,TValue> if the key does not already exist. Returns the new value, or the existing value if the key already exists. Declaration public static TValue GetOrAdd<TKey, TValue>(this IDictionary<TKey, TValue> dict, TKey key, TValue value) Parameters Type Name Description IDictionary <TKey, TValue> dict The dictionary to be operated on. TKey key The key of the element to add. TValue value The value to be added, if the key does not already exist. Returns Type Description TValue The value for the key. This will be either the existing value for the key if the key is already in the dictionary, or the new value if the key was not in the dictionary. Type Parameters Name Description TKey TValue | Improve this Doc View Source GetValueOrDefault<TKey, TValue>(IDictionary<TKey, TValue>, TKey) Gets the value that is associated with the specific key or the default value for the type TValue . Declaration public static TValue GetValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dict, TKey key) Parameters Type Name Description IDictionary <TKey, TValue> dict TKey key Returns Type Description TValue Type Parameters Name Description TKey TValue Remarks This is duplicated from GetValueOrDefault<TKey,TValue>(IReadOnlyDictionary<TKey,TValue>, TKey) because IDictionary<TKey,TValue> does not extend IReadOnlyDictionary<TKey,TValue> ."
},
"api/Recore.Collections.Generic.IIterator-1.html": {
"href": "api/Recore.Collections.Generic.IIterator-1.html",
"title": "Interface IIterator<T> | RecoreFX",
"keywords": "Interface IIterator<T> An alternative interface to IEnumerator<T> that provides access to a sequence of elements. Namespace : Recore.Collections.Generic Assembly : Recore.dll Syntax public interface IIterator<out T> Type Parameters Name Description T Remarks This interface is meant to resemble Java's concept of an iterator. While using IEnumerator<T> usually provides safer access to a collection than, say, manipulating indices directly in a list, there are times where it is clumsy to use. Examples A common case is calling an API that needs to tell its caller whether it should be called again. In order to do this with IEnumerator<T> , the API must look ahead to the next element with MoveNext() before returning and then maintain this state between calls. For example, consider this type that gets status information on a customer's order from some external source: using System.Collections.Generic; class OrderStatusUpdater { private readonly IEnumerator<string> statusEnumerator; private string currentStatus = null; // We need to look ahead so we know when we've returned the last element private string nextStatus = null; private bool isFinished = false; public OrderStatusUpdater(IEnumerable<string> statuses) { statusEnumerator = statuses.GetEnumerator(); UpdateStatus(); } private void UpdateStatus() { currentStatus = nextStatus; if (statusEnumerator.MoveNext()) { nextStatus = statusEnumerator.Current; } else { isFinished = true; } } public OrderStatus GetStatusUpdate() { UpdateStatus(); return new OrderStatus { Status = currentStatus, IsFinished = isFinished }; } } Now consider the code with IIterator<T> : using System.Collections.Generic; using Recore.Collections.Generic; class OrderStatusUpdater { private readonly IIterator<string> statusIterator; private string currentStatus = null; public OrderStatusUpdater(IEnumerable<string> statuses) { statusIterator = Iterator.FromEnumerable(statuses); } public OrderStatus GetStatusUpdate() { if (statusIterator.HasNext) { currentStatus = statusIterator.Next(); } return new OrderStatus { Status = currentStatus, IsFinished = !statusIterator.HasNext }; } } Properties | Improve this Doc View Source HasNext Whether the sequence has more elements. Declaration bool HasNext { get; } Property Value Type Description Boolean Methods | Improve this Doc View Source Next() Advances the iterator to the next element and returns it. Declaration T Next() Returns Type Description T Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.Collections.Generic.Iterator.html": {
"href": "api/Recore.Collections.Generic.Iterator.html",
"title": "Class Iterator | RecoreFX",
"keywords": "Class Iterator Provides helper methods for working with IIterator<T> . Inheritance Object Iterator Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore.Collections.Generic Assembly : Recore.dll Syntax public static class Iterator Methods | Improve this Doc View Source FromEnumerable<T>(IEnumerable<T>) Retrieves an IIterator<T> for the collection. Declaration public static IIterator<T> FromEnumerable<T>(IEnumerable<T> source) Parameters Type Name Description IEnumerable <T> source Returns Type Description IIterator <T> Type Parameters Name Description T | Improve this Doc View Source FromEnumerator<T>(IEnumerator<T>) Converts an IEnumerator<T> to an IIterator<T> . Declaration public static IIterator<T> FromEnumerator<T>(IEnumerator<T> enumerator) Parameters Type Name Description IEnumerator <T> enumerator Returns Type Description IIterator <T> Type Parameters Name Description T"
},
"api/Recore.Collections.Generic.LinkedListExtensions.html": {
"href": "api/Recore.Collections.Generic.LinkedListExtensions.html",
"title": "Class LinkedListExtensions | RecoreFX",
"keywords": "Class LinkedListExtensions Provides additional methods for working with LinkedList<T> . Inheritance Object LinkedListExtensions Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore.Collections.Generic Assembly : Recore.dll Syntax public static class LinkedListExtensions Methods | Improve this Doc View Source Add<T>(LinkedList<T>, T) Adds a new node with containing the specified value to the end of the LinkedList<T> . Declaration public static void Add<T>(this LinkedList<T> linkedList, T item) Parameters Type Name Description LinkedList <T> linkedList T item Type Parameters Name Description T Remarks This method is the same as AddLast(T) . It is needed to be able to use collection initializer syntax with LinkedList<T> ."
},
"api/Recore.Collections.Generic.ListExtensions.html": {
"href": "api/Recore.Collections.Generic.ListExtensions.html",
"title": "Class ListExtensions | RecoreFX",
"keywords": "Class ListExtensions Provides additional methods for working with List<T> . Inheritance Object ListExtensions Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore.Collections.Generic Assembly : Recore.dll Syntax public static class ListExtensions Methods | Improve this Doc View Source AppendRange<T>(List<T>, IEnumerable<T>) Adds the elements of the specified collection to the end of the list and passes the list through. Declaration public static List<T> AppendRange<T>(this List<T> list, IEnumerable<T> collection) Parameters Type Name Description List <T> list IEnumerable <T> collection Returns Type Description List <T> Type Parameters Name Description T"
},
"api/Recore.Collections.Generic.MappedComparer-2.html": {
"href": "api/Recore.Collections.Generic.MappedComparer-2.html",
"title": "Class MappedComparer<T, TMapped> | RecoreFX",
"keywords": "Class MappedComparer<T, TMapped> Compares instances of a type based on the output of a mapping function. Inheritance Object MappedComparer<T, TMapped> Implements IComparer <T> Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore.Collections.Generic Assembly : Recore.dll Syntax public sealed class MappedComparer<T, TMapped> : IComparer<T> Type Parameters Name Description T TMapped Constructors | Improve this Doc View Source MappedComparer(Func<T, TMapped>) Creates an instance of MappedComparer<T, TMapped> . Declaration public MappedComparer(Func<T, TMapped> mapping) Parameters Type Name Description Func <T, TMapped> mapping Methods | Improve this Doc View Source Compare(T, T) Compares the mapped output of two objects. Declaration public int Compare(T x, T y) Parameters Type Name Description T x T y Returns Type Description Int32 Implements System.Collections.Generic.IComparer<T> Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.Collections.Generic.MappedEqualityComparer-2.html": {
"href": "api/Recore.Collections.Generic.MappedEqualityComparer-2.html",
"title": "Class MappedEqualityComparer<T, TMapped> | RecoreFX",
"keywords": "Class MappedEqualityComparer<T, TMapped> Compares instances of a type based on the output of a mapping function. Inheritance Object MappedEqualityComparer<T, TMapped> Implements IEqualityComparer <T> Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore.Collections.Generic Assembly : Recore.dll Syntax public sealed class MappedEqualityComparer<T, TMapped> : IEqualityComparer<T> Type Parameters Name Description T TMapped Constructors | Improve this Doc View Source MappedEqualityComparer(Func<T, TMapped>) Creates an instance of MappedEqualityComparer<T, TMapped> . Declaration public MappedEqualityComparer(Func<T, TMapped> mapping) Parameters Type Name Description Func <T, TMapped> mapping Methods | Improve this Doc View Source Equals(T, T) Invokes the mapping function on two objects and checks if the outputs are equal. Declaration public bool Equals(T x, T y) Parameters Type Name Description T x T y Returns Type Description Boolean | Improve this Doc View Source GetHashCode(T) Hashes the mapped output of an object. Declaration public int GetHashCode(T obj) Parameters Type Name Description T obj Returns Type Description Int32 Implements System.Collections.Generic.IEqualityComparer<T> Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.Defer.html": {
"href": "api/Recore.Defer.html",
"title": "Class Defer | RecoreFX",
"keywords": "Class Defer Invokes an action when disposed. Inheritance Object Defer Implements IDisposable Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore Assembly : Recore.dll Syntax public sealed class Defer : IDisposable Remarks Not thread-safe. Concurrent calls to dispose the object may result in the action being invoked multiple times. However, sequential calls to Dispose() are idempotent. If an instance of this type is created and never disposed, the callback will not be called. By design, the callback is not called from the finalizer, which would happen non-determinstically. Examples Defer is for ad-hoc RAII . Say you want to perform some action before you exit a method, regardless of whether you return normally or throw an exception. This is usually something like releasing a resource that was acquired in the method. The classic way to do this in C# is with try-finally : try { Console.WriteLine(\"Doing stuff\"); } finally { Console.WriteLine(\"Running cleanup\"); } This isn't bad, but it adds an extra level of indentation and 6 extra lines for the try-finally . With Defer and C# 8's new using declarations, we can do it more simply: using var cleanup = new Defer(() => Console.WriteLine(\"Running cleanup\")); Console.WriteLine(\"Doing stuff\"); Constructors | Improve this Doc View Source Defer(Action) Initializes an object with an action to invoke when the object is disposed. Declaration public Defer(Action action) Parameters Type Name Description Action action Methods | Improve this Doc View Source Dispose() Invokes the callback registered with the object and marks the object as disposed. Declaration public void Dispose() Implements System.IDisposable Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.Either.html": {
"href": "api/Recore.Either.html",
"title": "Class Either | RecoreFX",
"keywords": "Class Either Provides additional methods for Either<TLeft, TRight> . Inheritance Object Either Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore Assembly : Recore.dll Syntax public static class Either Methods | Improve this Doc View Source Collapse<T>(Either<T, T>) Retrieves the value of an Either<TLeft, TRight> when TLeft and TRight are the same. Declaration public static T Collapse<T>(this Either<T, T> either) Parameters Type Name Description Either <T, T> either Returns Type Description T Type Parameters Name Description T | Improve this Doc View Source Lefts<TLeft, TRight>(IEnumerable<Either<TLeft, TRight>>) Collects all the left-side values from the sequence. Declaration public static IEnumerable<TLeft> Lefts<TLeft, TRight>(this IEnumerable<Either<TLeft, TRight>> source) Parameters Type Name Description IEnumerable < Either <TLeft, TRight>> source Returns Type Description IEnumerable <TLeft> Type Parameters Name Description TLeft TRight | Improve this Doc View Source Lift<TLeft, TRight>(Action<TLeft>, Action<TRight>) Combines two unary actions into a single action taking either of their parameters. Declaration public static Action<Either<TLeft, TRight>> Lift<TLeft, TRight>(Action<TLeft> leftAction, Action<TRight> rightAction) Parameters Type Name Description Action <TLeft> leftAction Action <TRight> rightAction Returns Type Description Action < Either <TLeft, TRight>> Type Parameters Name Description TLeft TRight | Improve this Doc View Source Lift<TLeft, TRight, TResult>(Func<TLeft, TResult>, Func<TRight, TResult>) Combines two unary functions with the same return type into a single function taking either of their parameters. Declaration public static Func<Either<TLeft, TRight>, TResult> Lift<TLeft, TRight, TResult>(Func<TLeft, TResult> leftFunc, Func<TRight, TResult> rightFunc) Parameters Type Name Description Func <TLeft, TResult> leftFunc Func <TRight, TResult> rightFunc Returns Type Description Func < Either <TLeft, TRight>, TResult> Type Parameters Name Description TLeft TRight TResult | Improve this Doc View Source Rights<TLeft, TRight>(IEnumerable<Either<TLeft, TRight>>) Collects all the right-side values from the sequence. Declaration public static IEnumerable<TRight> Rights<TLeft, TRight>(this IEnumerable<Either<TLeft, TRight>> source) Parameters Type Name Description IEnumerable < Either <TLeft, TRight>> source Returns Type Description IEnumerable <TRight> Type Parameters Name Description TLeft TRight"
},
"api/Recore.Either-2.html": {
"href": "api/Recore.Either-2.html",
"title": "Class Either<TLeft, TRight> | RecoreFX",
"keywords": "Class Either<TLeft, TRight> Represents a value that can be one of two types. Inheritance Object Either<TLeft, TRight> Implements IEquatable < Either <TLeft, TRight>> Inherited Members Object.Equals(Object, Object) Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Recore Assembly : Recore.dll Syntax [JsonConverter(typeof(EitherConverter))] public sealed class Either<TLeft, TRight> : IEquatable<Either<TLeft, TRight>> Type Parameters Name Description TLeft TRight Remarks When working with System.Text.Json , deserializing into Either<TLeft, TRight> can be ambiguous. The default deserialization behavior will try first to deserialize as TLeft , and then as TRight . But, this may return the unintended type if the left deserializer can successfully deserialize the JSON representation of the right. A common case is when both TLeft and TRight are POCOs. In that case, Either<TLeft, TRight> will always deserialize as TLeft , filling in default values for any missing properties. For example: class Person { public string Name { get; set; } public int Age { get; set; } } class Address { public string Street { get; set; } public string Zip { get; set; } } // Deserializes as a `Person`! JsonSerializer.Deserialize<Either<Person, Address>>(\"{\\\"Street\\\":\\\"123 Main St\\\",\\\"Zip\\\":\\\"12345\\\"}\") You can use OverrideEitherConverter<TLeft, TRight> to specify how to choose between TLeft and TRight based on the properties in the JSON: // Look at the JSON to decide which type we have options.Converters.Add(new OverrideEitherConverter<Person, Address>( deserializeAsLeft: json => json.TryGetProperty(\"Street\", out JsonElement _))); // Deserializes correctly JsonSerializer.Deserialize<Either<Person, Address>>(\"{\\\"Street\\\":\\\"123 Main St\\\",\\\"Zip\\\":\\\"12345\\\"}\", options) Examples Either<TLeft, TRight> creates a type with a value that can be one of two types. In this, it's similar to Optional<T> , which you can think of like Either<T, null> with some extra functionality. If you're familiar with TypeScript, you can think of Either<TLeft, TRight> as a union type: TLeft | TRight You create an instance of Either<TLeft, TRight> with one of its constructors, but the implicit conversion operator is pretty convenient too: Either<string, int> either = \"hello\"; Like Optional<T> , the main way to work with Either<TLeft, TRight> is with Switch() : either.Switch( l => Console.WriteLine($\"Value is a string: {l}\"), r => Console.WriteLine($\"Value is an int: {r}\")); you can also return a value: var message = either.Switch( l => $\"Value is a string: {l}\", r => $\"Value is an int: {r}\"); Compared to Optional<T> , though, where Switch() is more of a last resort when no higher-level idiom is available, Either<TLeft, TRight> leans on Switch() heavily. You can think of Either<TLeft, TRight> as being lower-level than Optional<T> . Either<TLeft, TRight> also has OnLeft() and OnRight() , analogous to Optional<T> 's OnValue() . (Note that there's no OnEmpty() ; you can just use if (!opt.HasValue) for that.) Either<string, bool> newEither = either.OnRight(x => x > 0); Constructors | Improve this Doc View Source Either(TLeft) Constructs an instance of the type from a value of TLeft . Declaration public Either(TLeft left) Parameters Type Name Description TLeft left | Improve this Doc View Source Either(TRight) Constructs an instance of the type from a value of TRight . Declaration public Either(TRight right) Parameters Type Name Description TRight right Properties | Improve this Doc View Source IsLeft Indicates whether the value is of type TLeft . Declaration public bool IsLeft { get; } Property Value Type Description Boolean | Improve this Doc View Source IsRight Indicates whether the value is of type TRight . Declaration public bool IsRight { get; } Property Value Type Description Boolean Methods | Improve this Doc View Source Equals(Either<TLeft, TRight>) Compares two instances of Either<TLeft, TRight> for equality. Declaration public bool Equals(Either<TLeft, TRight> other) Parameters Type Name Description Either <TLeft, TRight> other Returns Type Description Boolean Remarks Equality is defined as both objects' underlying values being equal and their underlying values occupying the same position (both left or both right). For example, Either<Color, Day>(Color.Red) != Either<Color, Day>(Day.Monday) even if Color.Red == Day.Monday . | Improve this Doc View Source Equals(Either<TLeft, TRight>, IEqualityComparer<TLeft>, IEqualityComparer<TRight>) Compares two instances of Either<TLeft, TRight> for equality using the given IEqualityComparer<T> . Declaration public bool Equals(Either<TLeft, TRight> other, IEqualityComparer<TLeft> leftComparer, IEqualityComparer<TRight> rightComparer) Parameters Type Name Description Either <TLeft, TRight> other IEqualityComparer <TLeft> leftComparer IEqualityComparer <TRight> rightComparer Returns Type Description Boolean | Improve this Doc View Source Equals(Object) Compares this Either<TLeft, TRight> to another object for equality. Declaration public override bool Equals(object obj) Parameters Type Name Description Object obj Returns Type Description Boolean Overrides Object.Equals(Object) Remarks Two Either<TLeft, TRight> s are equal only if they have the same type parameters in the same order. For example, an Either<int, string> and an Either<string, int> will always be nonequal. | Improve this Doc View Source GetHashCode() Returns the hash code of the underlying value. Declaration public override int GetHashCode() Returns Type Description Int32 Overrides Object.GetHashCode() | Improve this Doc View Source GetLeft() Converts Either<TLeft, TRight> to Optional<TLeft> . Declaration public Optional<TLeft> GetLeft() Returns Type Description Optional <TLeft> | Improve this Doc View Source GetRight() Converts Either<TLeft, TRight> to Optional<TRight> . Declaration public Optional<TRight> GetRight() Returns Type Description Optional <TRight> | Improve this Doc View Source IfLeft(Action<TLeft>) Takes an action only if the value is an instance of TLeft . Declaration public void IfLeft(Action<TLeft> onLeft) Parameters Type Name Description Action <TLeft> onLeft | Improve this Doc View Source IfRight(Action<TRight>) Takes an action only if the value is an instance of TRight . Declaration public void IfRight(Action<TRight> onRight) Parameters Type Name Description Action <TRight> onRight | Improve this Doc View Source OnLeft<TResult>(Func<TLeft, TResult>) Maps a function over the Either<TLeft, TRight> only if the value is an instance of TLeft . Declaration public Either<TResult, TRight> OnLeft<TResult>(Func<TLeft, TResult> onLeft) Parameters Type Name Description Func <TLeft, TResult> onLeft Returns Type Description Either <TResult, TRight> Type Parameters Name Description TResult | Improve this Doc View Source OnRight<TResult>(Func<TRight, TResult>) Maps a function over the Either<TLeft, TRight> only if the value is an instance of TRight . Declaration public Either<TLeft, TResult> OnRight<TResult>(Func<TRight, TResult> onRight) Parameters Type Name Description Func <TRight, TResult> onRight Returns Type Description Either <TLeft, TResult> Type Parameters Name Description TResult | Improve this Doc View Source Swap() Converts this Either<TLeft, TRight> to an Either<TRight, TLeft> . Declaration public Either<TRight, TLeft> Swap() Returns Type Description Either <TRight, TLeft> | Improve this Doc View Source Switch(Action<TLeft>, Action<TRight>) Takes one of two actions depending on the underlying value. Declaration public void Switch(Action<TLeft> onLeft, Action<TRight> onRight) Parameters Type Name Description Action <TLeft> onLeft Action <TRight> onRight | Improve this Doc View Source Switch<T>(Func<TLeft, T>, Func<TRight, T>) Calls one of two functions depending on the underlying value. Declaration public T Switch<T>(Func<TLeft, T> onLeft, Func<TRight, T> onRight) Parameters Type Name Description Func <TLeft, T> onLeft Func <TRight, T> onRight Returns Type Description T Type Parameters Name Description T | Improve this Doc View Source ToString() Returns the string representation of the underlying value. Declaration public override string ToString() Returns Type Description String Overrides Object.ToString() Operators | Improve this Doc View Source Equality(Either<TLeft, TRight>, Either<TLeft, TRight>) Determines whether two instances of Either<TLeft, TRight> have the same value. Declaration public static bool operator ==(Either<TLeft, TRight> lhs, Either<TLeft, TRight> rhs) Parameters Type Name Description Either <TLeft, TRight> lhs Either <TLeft, TRight> rhs Returns Type Description Boolean | Improve this Doc View Source Implicit(TLeft to Either<TLeft, TRight>) Converts an instance of a type to an Either<TLeft, TRight> . Declaration public static implicit operator Either<TLeft, TRight>(TLeft left) Parameters Type Name Description TLeft left Returns Type Description Either <TLeft, TRight> | Improve this Doc View Source Implicit(TRight to Either<TLeft, TRight>) Converts an instance of a type to an Either<TLeft, TRight> . Declaration public static implicit operator Either<TLeft, TRight>(TRight right) Parameters Type Name Description TRight right Returns Type Description Either <TLeft, TRight> | Improve this Doc View Source Inequality(Either<TLeft, TRight>, Either<TLeft, TRight>) Determines whether two instances of Either<TLeft, TRight> have different values. Declaration public static bool operator !=(Either<TLeft, TRight> lhs, Either<TLeft, TRight> rhs) Parameters Type Name Description Either <TLeft, TRight> lhs Either <TLeft, TRight> rhs Returns Type Description Boolean Implements System.IEquatable<T> Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.Func.html": {
"href": "api/Recore.Func.html",
"title": "Class Func | RecoreFX",
"keywords": "Class Func Contains methods for working with functions. Inheritance Object Func Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore Assembly : Recore.dll Syntax public static class Func Methods | Improve this Doc View Source AsyncFluent<T>(AsyncAction<T>) Passes through the argument passed to a Task-returning routine. Declaration public static AsyncFunc<T, T> AsyncFluent<T>(this AsyncAction<T> action) Parameters Type Name Description AsyncAction <T> action Returns Type Description AsyncFunc <T, T> Type Parameters Name Description T | Improve this Doc View Source Fluent<T>(Action<T>) Passes through the argument passed to a void-returning routine. Declaration public static Func<T, T> Fluent<T>(this Action<T> action) Parameters Type Name Description Action <T> action Returns Type Description Func <T, T> Type Parameters Name Description T | Improve this Doc View Source Invoke<T>(Func<T>) Calls a function and return its result. Declaration public static T Invoke<T>(Func<T> f) Parameters Type Name Description Func <T> f Returns Type Description T Type Parameters Name Description T Remarks This method is useful for making immediately-invoked function expressions in C#."
},
"api/Recore.html": {
"href": "api/Recore.html",
"title": "Namespace Recore | RecoreFX",
"keywords": "Namespace Recore Classes AbsoluteUri Represents an absolute URI. AsyncDefer Invokes an asynchronous action when disposed. Defer Invokes an action when disposed. Either Provides additional methods for Either<TLeft, TRight> . Either<TLeft, TRight> Represents a value that can be one of two types. Func Contains methods for working with functions. ObjectExtensions Helper methods for working with any object in .NET. Of<T> Abstract base class for defining types that alias an existing type. OfJsonAttribute Place on an subtype of Of<T> to serialize it to JSON as its underlying type. Optional Provides additional methods for Optional<T> . RelativeUri Represents a relative URI. Result Provides additional methods for Result<TValue, TError> . Result.AsyncCatcher<TValue> Wraps a function to be executed and converted to Result<TValue, TError> . Result.Catcher<TValue> Wraps a function to be executed and converted to Result<TValue, TError> . Result<TValue, TError> Represents the result of an operation that can be successful or failed. UriExtensions Extension methods for the Uri type. Structs Optional<T> Provides type-safe access to a nullable value. Unit A type with only one value. Delegates AsyncAction Encapsulates an asynchronous method that has no parameters and does not return a value. Equivalent to Func<Task> . AsyncAction<T> Encapsulates an asynchronous method that has one parameter and does not return a value. Equivalent to Func<T, Task> . AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Encapsulates an asynchronous method that has 10 parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, Task> . AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Encapsulates an asynchronous method that has 11 parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, Task> . AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Encapsulates an asynchronous method that has 12 parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, Task> . AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Encapsulates an asynchronous method that has 13 parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Task> . AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Encapsulates an asynchronous method that has 14 parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, Task> . AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Encapsulates an asynchronous method that has 15 parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, Task> . AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Encapsulates an asynchronous method that has 16 parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, Task> . AsyncAction<T1, T2> Encapsulates an asynchronous method that has two parameters and does not return a value. Equivalent to Func<T1, T2, Task> . AsyncAction<T1, T2, T3> Encapsulates an asynchronous method that has three parameters and does not return a value. Equivalent to Func<T1, T2, T3, Task> . AsyncAction<T1, T2, T3, T4> Encapsulates an asynchronous method that has four parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, Task> . AsyncAction<T1, T2, T3, T4, T5> Encapsulates an asynchronous method that has five parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, Task> . AsyncAction<T1, T2, T3, T4, T5, T6> Encapsulates an asynchronous method that has six parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, Task> . AsyncAction<T1, T2, T3, T4, T5, T6, T7> Encapsulates an asynchronous method that has seven parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, Task> . AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8> Encapsulates an asynchronous method that has eight parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, Task> . AsyncAction<T1, T2, T3, T4, T5, T6, T7, T8, T9> Encapsulates an asynchronous method that has nine parameters and does not return a value. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, Task> . AsyncFunc<TResult> Encapsulates an asynchronous method that has no parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<Task<TResult>> . AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult> Encapsulates an asynchronous method that has nine parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, Task<TResult>> . AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult> Encapsulates an asynchronous method that has 10 parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, Task<TResult>> . AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult> Encapsulates an asynchronous method that has 11 parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, Task<TResult>> . AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult> Encapsulates an asynchronous method that has 12 parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, Task<TResult>> . AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult> Encapsulates an asynchronous method that has 13 parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Task<TResult>> . AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult> Encapsulates an asynchronous method that has 14 parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, Task<TResult>> . AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult> Encapsulates an asynchronous method that has 15 parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, Task<TResult>> . AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult> Encapsulates an asynchronous method that has 16 parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, Task<TResult>> . AsyncFunc<T, TResult> Encapsulates an asynchronous method that has one parameter and returns a value of the type specified by the TResult parameter. Equivalent to Func<Task<TResult>> . AsyncFunc<T1, T2, TResult> Encapsulates an asynchronous method that has two parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, Task<TResult>> . AsyncFunc<T1, T2, T3, TResult> Encapsulates an asynchronous method that has three parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, Task<TResult>> . AsyncFunc<T1, T2, T3, T4, TResult> Encapsulates an asynchronous method that has four parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, Task<TResult>> . AsyncFunc<T1, T2, T3, T4, T5, TResult> Encapsulates an asynchronous method that has five parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, Task<TResult>> . AsyncFunc<T1, T2, T3, T4, T5, T6, TResult> Encapsulates an asynchronous method that has six parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, Task<TResult>> . AsyncFunc<T1, T2, T3, T4, T5, T6, T7, TResult> Encapsulates an asynchronous method that has seven parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, Task<TResult>> . AsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, TResult> Encapsulates an asynchronous method that has eight parameters and returns a value of the type specified by the TResult parameter. Equivalent to Func<T1, T2, T3, T4, T5, T6, T7, T8, Task<TResult>> ."
},
"api/Recore.Linq.html": {
"href": "api/Recore.Linq.html",
"title": "Namespace Recore.Linq | RecoreFX",
"keywords": "Namespace Recore.Linq Classes Renumerable Provides additional methods for working with objects that implement IEnumerable<T> ."
},
"api/Recore.Linq.Renumerable.html": {
"href": "api/Recore.Linq.Renumerable.html",
"title": "Class Renumerable | RecoreFX",
"keywords": "Class Renumerable Provides additional methods for working with objects that implement IEnumerable<T> . Inheritance Object Renumerable Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore.Linq Assembly : Recore.dll Syntax public static class Renumerable Methods | Improve this Doc View Source Argmax(IEnumerable<Decimal>) Returns the maximum value and the index of the maximum value from a sequence of Decimal values. Declaration public static (int Argmax, decimal Max) Argmax(this IEnumerable<decimal> source) Parameters Type Name Description IEnumerable < Decimal > source Returns Type Description ValueTuple < Int32 , Decimal > | Improve this Doc View Source Argmax(IEnumerable<Double>) Returns the maximum value and the index of the maximum value from a sequence of Double values. Declaration public static (int Argmax, double Max) Argmax(this IEnumerable<double> source) Parameters Type Name Description IEnumerable < Double > source Returns Type Description ValueTuple < Int32 , Double > | Improve this Doc View Source Argmax(IEnumerable<Int32>) Returns the maximum value and the index of the maximum value from a sequence of Int32 values. Declaration public static (int Argmax, int Max) Argmax(this IEnumerable<int> source) Parameters Type Name Description IEnumerable < Int32 > source Returns Type Description ValueTuple < Int32 , Int32 > | Improve this Doc View Source Argmax(IEnumerable<Int64>) Returns the maximum value and the index of the maximum value from a sequence of Int64 values. Declaration public static (int Argmax, long Max) Argmax(this IEnumerable<long> source) Parameters Type Name Description IEnumerable < Int64 > source Returns Type Description ValueTuple < Int32 , Int64 > | Improve this Doc View Source Argmax(IEnumerable<Nullable<Decimal>>) Returns the maximum value and the index of the maximum value from a sequence of nullable Decimal values. Declaration public static (int Argmax, decimal? Max) Argmax(this IEnumerable<decimal?> source) Parameters Type Name Description IEnumerable < Nullable < Decimal >> source Returns Type Description ValueTuple < Int32 , Nullable < Decimal >> | Improve this Doc View Source Argmax(IEnumerable<Nullable<Double>>) Returns the maximum value and the index of the maximum value from a sequence of nullable Double values. Declaration public static (int Argmax, double? Max) Argmax(this IEnumerable<double?> source) Parameters Type Name Description IEnumerable < Nullable < Double >> source Returns Type Description ValueTuple < Int32 , Nullable < Double >> | Improve this Doc View Source Argmax(IEnumerable<Nullable<Int32>>) Returns the maximum value and the index of the maximum value from a sequence of nullable Int32 values. Declaration public static (int Argmax, int? Max) Argmax(this IEnumerable<int?> source) Parameters Type Name Description IEnumerable < Nullable < Int32 >> source Returns Type Description ValueTuple < Int32 , Nullable < Int32 >> | Improve this Doc View Source Argmax(IEnumerable<Nullable<Int64>>) Returns the maximum value and the index of the maximum value from a sequence of nullable Int64 values. Declaration public static (int Argmax, long? Max) Argmax(this IEnumerable<long?> source) Parameters Type Name Description IEnumerable < Nullable < Int64 >> source Returns Type Description ValueTuple < Int32 , Nullable < Int64 >> | Improve this Doc View Source Argmax(IEnumerable<Nullable<Single>>) Returns the maximum value and the index of the maximum value from a sequence of nullable Single values. Declaration public static (int Argmax, float? Max) Argmax(this IEnumerable<float?> source) Parameters Type Name Description IEnumerable < Nullable < Single >> source Returns Type Description ValueTuple < Int32 , Nullable < Single >> | Improve this Doc View Source Argmax(IEnumerable<Single>) Returns the maximum value and the index of the maximum value from a sequence of Single values. Declaration public static (int Argmax, float Max) Argmax(this IEnumerable<float> source) Parameters Type Name Description IEnumerable < Single > source Returns Type Description ValueTuple < Int32 , Single > | Improve this Doc View Source Argmax<TSource>(IEnumerable<TSource>) Returns the maximum value and the index of the maximum value from a sequence of values. Declaration public static (int Argmax, TSource Max) Argmax<TSource>(this IEnumerable<TSource> source) Parameters Type Name Description IEnumerable <TSource> source Returns Type Description ValueTuple < Int32 , TSource> Type Parameters Name Description TSource | Improve this Doc View Source Argmax<TSource>(IEnumerable<TSource>, Func<TSource, Decimal>) Returns the maximum value and the maximizing value for a function returning Decimal on a sequence of values. Declaration public static (TSource Argmax, decimal Max) Argmax<TSource>(this IEnumerable<TSource> source, Func<TSource, decimal> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Decimal > selector Returns Type Description ValueTuple <TSource, Decimal > Type Parameters Name Description TSource | Improve this Doc View Source Argmax<TSource>(IEnumerable<TSource>, Func<TSource, Double>) Returns the maximum value and the maximizing value for a function returning Double on a sequence of values. Declaration public static (TSource Argmax, double Max) Argmax<TSource>(this IEnumerable<TSource> source, Func<TSource, double> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Double > selector Returns Type Description ValueTuple <TSource, Double > Type Parameters Name Description TSource | Improve this Doc View Source Argmax<TSource>(IEnumerable<TSource>, Func<TSource, Int32>) Returns the maximum value and the maximizing value for a function returning Int32 on a sequence of values. Declaration public static (TSource Argmax, int Max) Argmax<TSource>(this IEnumerable<TSource> source, Func<TSource, int> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Int32 > selector Returns Type Description ValueTuple <TSource, Int32 > Type Parameters Name Description TSource | Improve this Doc View Source Argmax<TSource>(IEnumerable<TSource>, Func<TSource, Int64>) Returns the maximum value and the maximizing value for a function returning Int64 on a sequence of values. Declaration public static (TSource Argmax, long Max) Argmax<TSource>(this IEnumerable<TSource> source, Func<TSource, long> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Int64 > selector Returns Type Description ValueTuple <TSource, Int64 > Type Parameters Name Description TSource | Improve this Doc View Source Argmax<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Decimal>>) Returns the maximum value and the maximizing value for a function returning nullable Decimal on a sequence of values. Declaration public static (TSource Argmax, decimal? Max) Argmax<TSource>(this IEnumerable<TSource> source, Func<TSource, decimal?> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Nullable < Decimal >> selector Returns Type Description ValueTuple <TSource, Nullable < Decimal >> Type Parameters Name Description TSource | Improve this Doc View Source Argmax<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Double>>) Returns the maximum value and the maximizing value for a function returning nullable Double on a sequence of values. Declaration public static (TSource Argmax, double? Max) Argmax<TSource>(this IEnumerable<TSource> source, Func<TSource, double?> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Nullable < Double >> selector Returns Type Description ValueTuple <TSource, Nullable < Double >> Type Parameters Name Description TSource | Improve this Doc View Source Argmax<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Int32>>) Returns the maximum value and the maximizing value for a function returning nullable Int32 on a sequence of values. Declaration public static (TSource Argmax, int? Max) Argmax<TSource>(this IEnumerable<TSource> source, Func<TSource, int?> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Nullable < Int32 >> selector Returns Type Description ValueTuple <TSource, Nullable < Int32 >> Type Parameters Name Description TSource | Improve this Doc View Source Argmax<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Int64>>) Returns the maximum value and the maximizing value for a function returning nullable Int64 on a sequence of values. Declaration public static (TSource Argmax, long? Max) Argmax<TSource>(this IEnumerable<TSource> source, Func<TSource, long?> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Nullable < Int64 >> selector Returns Type Description ValueTuple <TSource, Nullable < Int64 >> Type Parameters Name Description TSource | Improve this Doc View Source Argmax<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Single>>) Returns the maximum value and the maximizing value for a function returning nullable Single on a sequence of values. Declaration public static (TSource Argmax, float? Max) Argmax<TSource>(this IEnumerable<TSource> source, Func<TSource, float?> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Nullable < Single >> selector Returns Type Description ValueTuple <TSource, Nullable < Single >> Type Parameters Name Description TSource | Improve this Doc View Source Argmax<TSource>(IEnumerable<TSource>, Func<TSource, Single>) Returns the maximum value and the maximizing value for a function returning Single on a sequence of values. Declaration public static (TSource Argmax, float Max) Argmax<TSource>(this IEnumerable<TSource> source, Func<TSource, float> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Single > selector Returns Type Description ValueTuple <TSource, Single > Type Parameters Name Description TSource | Improve this Doc View Source Argmax<TSource, TResult>(IEnumerable<TSource>, Func<TSource, TResult>) Returns the maximum value and the maximizing value for a function on a sequence of values. Declaration public static (TSource Argmax, TResult Max) Argmax<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, TResult> selector Returns Type Description ValueTuple <TSource, TResult> Type Parameters Name Description TSource TResult | Improve this Doc View Source Argmin(IEnumerable<Decimal>) Returns the minimum value and the index of the minimum value from a sequence of Decimal values. Declaration public static (int Argmin, decimal Min) Argmin(this IEnumerable<decimal> source) Parameters Type Name Description IEnumerable < Decimal > source Returns Type Description ValueTuple < Int32 , Decimal > | Improve this Doc View Source Argmin(IEnumerable<Double>) Returns the minimum value and the index of the minimum value from a sequence of Double values. Declaration public static (int Argmin, double Min) Argmin(this IEnumerable<double> source) Parameters Type Name Description IEnumerable < Double > source Returns Type Description ValueTuple < Int32 , Double > | Improve this Doc View Source Argmin(IEnumerable<Int32>) Returns the minimum value and the index of the minimum value from a sequence of Int32 values. Declaration public static (int Argmin, int Min) Argmin(this IEnumerable<int> source) Parameters Type Name Description IEnumerable < Int32 > source Returns Type Description ValueTuple < Int32 , Int32 > | Improve this Doc View Source Argmin(IEnumerable<Int64>) Returns the minimum value and the index of the minimum value from a sequence of Int64 values. Declaration public static (int Argmin, long Min) Argmin(this IEnumerable<long> source) Parameters Type Name Description IEnumerable < Int64 > source Returns Type Description ValueTuple < Int32 , Int64 > | Improve this Doc View Source Argmin(IEnumerable<Nullable<Decimal>>) Returns the minimum value and the index of the minimum value from a sequence of nullable Decimal values. Declaration public static (int Argmin, decimal? Min) Argmin(this IEnumerable<decimal?> source) Parameters Type Name Description IEnumerable < Nullable < Decimal >> source Returns Type Description ValueTuple < Int32 , Nullable < Decimal >> | Improve this Doc View Source Argmin(IEnumerable<Nullable<Double>>) Returns the minimum value and the index of the minimum value from a sequence of nullable Double values. Declaration public static (int Argmin, double? Min) Argmin(this IEnumerable<double?> source) Parameters Type Name Description IEnumerable < Nullable < Double >> source Returns Type Description ValueTuple < Int32 , Nullable < Double >> | Improve this Doc View Source Argmin(IEnumerable<Nullable<Int32>>) Returns the minimum value and the index of the minimum value from a sequence of nullable Int32 values. Declaration public static (int Argmin, int? Min) Argmin(this IEnumerable<int?> source) Parameters Type Name Description IEnumerable < Nullable < Int32 >> source Returns Type Description ValueTuple < Int32 , Nullable < Int32 >> | Improve this Doc View Source Argmin(IEnumerable<Nullable<Int64>>) Returns the minimum value and the index of the minimum value from a sequence of nullable Int64 values. Declaration public static (int Argmin, long? Min) Argmin(this IEnumerable<long?> source) Parameters Type Name Description IEnumerable < Nullable < Int64 >> source Returns Type Description ValueTuple < Int32 , Nullable < Int64 >> | Improve this Doc View Source Argmin(IEnumerable<Nullable<Single>>) Returns the minimum value and the index of the minimum value from a sequence of nullable Single values. Declaration public static (int Argmin, float? Min) Argmin(this IEnumerable<float?> source) Parameters Type Name Description IEnumerable < Nullable < Single >> source Returns Type Description ValueTuple < Int32 , Nullable < Single >> | Improve this Doc View Source Argmin(IEnumerable<Single>) Returns the minimum value and the index of the minimum value from a sequence of Single values. Declaration public static (int Argmin, float Min) Argmin(this IEnumerable<float> source) Parameters Type Name Description IEnumerable < Single > source Returns Type Description ValueTuple < Int32 , Single > | Improve this Doc View Source Argmin<TSource>(IEnumerable<TSource>) Returns the minimum value and the index of the minimum value from a sequence of values. Declaration public static (int Argmin, TSource Min) Argmin<TSource>(this IEnumerable<TSource> source) Parameters Type Name Description IEnumerable <TSource> source Returns Type Description ValueTuple < Int32 , TSource> Type Parameters Name Description TSource | Improve this Doc View Source Argmin<TSource>(IEnumerable<TSource>, Func<TSource, Decimal>) Returns the minimum value and the minimizing value for a function returning nullable Decimal on a sequence of values. Declaration public static (TSource Argmin, decimal Min) Argmin<TSource>(this IEnumerable<TSource> source, Func<TSource, decimal> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Decimal > selector Returns Type Description ValueTuple <TSource, Decimal > Type Parameters Name Description TSource | Improve this Doc View Source Argmin<TSource>(IEnumerable<TSource>, Func<TSource, Double>) Returns the minimum value and the minimizing value for a function returning Double on a sequence of values. Declaration public static (TSource Argmin, double Min) Argmin<TSource>(this IEnumerable<TSource> source, Func<TSource, double> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Double > selector Returns Type Description ValueTuple <TSource, Double > Type Parameters Name Description TSource | Improve this Doc View Source Argmin<TSource>(IEnumerable<TSource>, Func<TSource, Int32>) Returns the minimum value and the minimizing value for a function returning Int32 on a sequence of values. Declaration public static (TSource Argmin, int Min) Argmin<TSource>(this IEnumerable<TSource> source, Func<TSource, int> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Int32 > selector Returns Type Description ValueTuple <TSource, Int32 > Type Parameters Name Description TSource | Improve this Doc View Source Argmin<TSource>(IEnumerable<TSource>, Func<TSource, Int64>) Returns the minimum value and the minimizing value for a function returning Int64 on a sequence of values. Declaration public static (TSource Argmin, long Min) Argmin<TSource>(this IEnumerable<TSource> source, Func<TSource, long> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Int64 > selector Returns Type Description ValueTuple <TSource, Int64 > Type Parameters Name Description TSource | Improve this Doc View Source Argmin<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Decimal>>) Returns the minimum value and the minimizing value for a function returning nullable Decimal on a sequence of values. Declaration public static (TSource Argmin, decimal? Min) Argmin<TSource>(this IEnumerable<TSource> source, Func<TSource, decimal?> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Nullable < Decimal >> selector Returns Type Description ValueTuple <TSource, Nullable < Decimal >> Type Parameters Name Description TSource | Improve this Doc View Source Argmin<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Double>>) Returns the minimum value and the minimizing value for a function returning nullable Double on a sequence of values. Declaration public static (TSource Argmin, double? Min) Argmin<TSource>(this IEnumerable<TSource> source, Func<TSource, double?> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Nullable < Double >> selector Returns Type Description ValueTuple <TSource, Nullable < Double >> Type Parameters Name Description TSource | Improve this Doc View Source Argmin<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Int32>>) Returns the minimum value and the minimizing value for a function returning nullable Int32 on a sequence of values. Declaration public static (TSource Argmin, int? Min) Argmin<TSource>(this IEnumerable<TSource> source, Func<TSource, int?> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Nullable < Int32 >> selector Returns Type Description ValueTuple <TSource, Nullable < Int32 >> Type Parameters Name Description TSource | Improve this Doc View Source Argmin<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Int64>>) Returns the minimum value and the minimizing value for a function returning nullable Int64 on a sequence of values. Declaration public static (TSource Argmin, long? Min) Argmin<TSource>(this IEnumerable<TSource> source, Func<TSource, long?> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Nullable < Int64 >> selector Returns Type Description ValueTuple <TSource, Nullable < Int64 >> Type Parameters Name Description TSource | Improve this Doc View Source Argmin<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Single>>) Returns the minimum value and the minimizing value for a function returning nullable Single on a sequence of values. Declaration public static (TSource Argmin, float? Min) Argmin<TSource>(this IEnumerable<TSource> source, Func<TSource, float?> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Nullable < Single >> selector Returns Type Description ValueTuple <TSource, Nullable < Single >> Type Parameters Name Description TSource | Improve this Doc View Source Argmin<TSource>(IEnumerable<TSource>, Func<TSource, Single>) Returns the minimum value and the minimizing value for a function returning Single on a sequence of values. Declaration public static (TSource Argmin, float Min) Argmin<TSource>(this IEnumerable<TSource> source, Func<TSource, float> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, Single > selector Returns Type Description ValueTuple <TSource, Single > Type Parameters Name Description TSource | Improve this Doc View Source Argmin<TSource, TResult>(IEnumerable<TSource>, Func<TSource, TResult>) Returns the minimum value and the minimizing value for a function on a sequence of values. Declaration public static (TSource Argmin, TResult Min) Argmin<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector) Parameters Type Name Description IEnumerable <TSource> source Func <TSource, TResult> selector Returns Type Description ValueTuple <TSource, TResult> Type Parameters Name Description TSource TResult | Improve this Doc View Source Enumerate<TSource>(IEnumerable<TSource>) Returns each element from a sequence along with its number from the beginning of the sequence, starting from zero. Declaration public static IEnumerable<(int Index, TSource Item)> Enumerate<TSource>(this IEnumerable<TSource> source) Parameters Type Name Description IEnumerable <TSource> source Returns Type Description IEnumerable < ValueTuple < Int32 , TSource>> Type Parameters Name Description TSource | Improve this Doc View Source Flatten<TSource>(IEnumerable<IEnumerable<TSource>>) Converts a sequence of sequences into a single sequence. Declaration public static IEnumerable<TSource> Flatten<TSource>(this IEnumerable<IEnumerable<TSource>> source) Parameters Type Name Description IEnumerable < IEnumerable <TSource>> source Returns Type Description IEnumerable <TSource> Type Parameters Name Description TSource | Improve this Doc View Source ForEach<TSource>(IEnumerable<TSource>, Action<TSource>) Performs an action on each element in a sequence. Declaration public static void ForEach<TSource>(this IEnumerable<TSource> source, Action<TSource> action) Parameters Type Name Description IEnumerable <TSource> source Action <TSource> action Type Parameters Name Description TSource Remarks This method is evaluated eagerly. | Improve this Doc View Source Lift<T>(Action<T>) Converts an action operating on a scalar value to an action operating on a sequence of values. Declaration public static Action<IEnumerable<T>> Lift<T>(Action<T> action) Parameters Type Name Description Action <T> action Returns Type Description Action < IEnumerable <T>> Type Parameters Name Description T | Improve this Doc View Source Lift<T, TResult>(Func<T, TResult>) Converts a function operating on a scalar value to a function operating on a sequence of values. Declaration public static Func<IEnumerable<T>, IEnumerable<TResult>> Lift<T, TResult>(Func<T, TResult> func) Parameters Type Name Description Func <T, TResult> func Returns Type Description Func < IEnumerable <T>, IEnumerable <TResult>> Type Parameters Name Description T TResult | Improve this Doc View Source NonNull<TSource>(IEnumerable<TSource>) Collects all non-null values from the sequence. Declaration public static IEnumerable<TSource> NonNull<TSource>(this IEnumerable<TSource> source) where TSource : class Parameters Type Name Description IEnumerable <TSource> source Returns Type Description IEnumerable <TSource> Type Parameters Name Description TSource | Improve this Doc View Source NonNull<TSource>(IEnumerable<Nullable<TSource>>) Collects all non-null values from the sequence. Declaration public static IEnumerable<TSource> NonNull<TSource>(this IEnumerable<TSource?> source) where TSource : struct Parameters Type Name Description IEnumerable < Nullable <TSource>> source Returns Type Description IEnumerable <TSource> Type Parameters Name Description TSource | Improve this Doc View Source OnKeys<TKey, TValue, TResult>(IEnumerable<KeyValuePair<TKey, TValue>>, Func<TKey, TResult>) Projects each key in a sequence of key-value pairs to a new form. Declaration public static IEnumerable<KeyValuePair<TResult, TValue>> OnKeys<TKey, TValue, TResult>(this IEnumerable<KeyValuePair<TKey, TValue>> source, Func<TKey, TResult> func) Parameters Type Name Description IEnumerable < KeyValuePair <TKey, TValue>> source Func <TKey, TResult> func Returns Type Description IEnumerable < KeyValuePair <TResult, TValue>> Type Parameters Name Description TKey TValue TResult | Improve this Doc View Source OnValues<TKey, TValue, TResult>(IEnumerable<KeyValuePair<TKey, TValue>>, Func<TValue, TResult>) Projects each value in a sequence of key-value pairs to a new form. Declaration public static IEnumerable<KeyValuePair<TKey, TResult>> OnValues<TKey, TValue, TResult>(this IEnumerable<KeyValuePair<TKey, TValue>> source, Func<TValue, TResult> func) Parameters Type Name Description IEnumerable < KeyValuePair <TKey, TValue>> source Func <TValue, TResult> func Returns Type Description IEnumerable < KeyValuePair <TKey, TResult>> Type Parameters Name Description TKey TValue TResult | Improve this Doc View Source Product<TFirst, TSecond>(IEnumerable<TFirst>, IEnumerable<TSecond>) Returns each element from a sequence along with its number from the beginning of the sequence, starting from zero. Declaration public static IEnumerable<(TFirst first, TSecond second)> Product<TFirst, TSecond>(this IEnumerable<TFirst> first, IEnumerable<TSecond> second) Parameters Type Name Description IEnumerable <TFirst> first IEnumerable <TSecond> second Returns Type Description IEnumerable < ValueTuple <TFirst, TSecond>> Type Parameters Name Description TFirst TSecond | Improve this Doc View Source ToAsyncEnumerable<T>(IEnumerable<Task<T>>) Converts an sequence of tasks to IAsyncEnumerable<T> . Declaration public static IAsyncEnumerable<T> ToAsyncEnumerable<T>(this IEnumerable<Task<T>> source) Parameters Type Name Description IEnumerable < Task <T>> source Returns Type Description IAsyncEnumerable <T> Type Parameters Name Description T Remarks This is a shim to help more methods work with IAsyncEnumerable<T> and encourage its use in a codebase. | Improve this Doc View Source ToAsyncEnumerable<T>(Task<IEnumerable<T>>) Converts an asynchronously-returned sequence of T to IAsyncEnumerable<T> . Declaration public static IAsyncEnumerable<T> ToAsyncEnumerable<T>(this Task<IEnumerable<T>> source) Parameters Type Name Description Task < IEnumerable <T>> source Returns Type Description IAsyncEnumerable <T> Type Parameters Name Description T Remarks The IAsyncEnumerable<T> returned by this method won't yield the same throughput improvement of asynchronously generating each element in the sequence. Rather, this is a shim to help more methods work with IAsyncEnumerable<T> and encourage its use in a codebase. | Improve this Doc View Source ToDictionary<TKey, TValue>(IEnumerable<KeyValuePair<TKey, TValue>>) Creates a Dictionary<TKey,TValue> from a sequence of key-value pairs. Declaration public static Dictionary<TKey, TValue> ToDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source) Parameters Type Name Description IEnumerable < KeyValuePair <TKey, TValue>> source Returns Type Description Dictionary <TKey, TValue> Type Parameters Name Description TKey TValue | Improve this Doc View Source ToLinkedList<TSource>(IEnumerable<TSource>) Creates a LinkedList<T> from an IEnumerable<T> . Declaration public static LinkedList<TSource> ToLinkedList<TSource>(this IEnumerable<TSource> source) Parameters Type Name Description IEnumerable <TSource> source Returns Type Description LinkedList <TSource> Type Parameters Name Description TSource Remarks Linked lists don't need to be resized when adding elements, which can give this method better performance than ToList<TSource>(IEnumerable<TSource>) or ToArray<TSource>(IEnumerable<TSource>) . A common case is when you just want to force eager evaluation of a series of operations on an IEnumerable<T> or when you want to cache elements when performing multiple enumerations. For these cases, you don't need random access to elements, which makes LinkedList<T> a suitable data structure for storing the elements. | Improve this Doc View Source Zip<TFirst, TSecond>(IEnumerable<TFirst>, IEnumerable<TSecond>) Merges two sequences to a single sequence of tuples. Declaration public static IEnumerable<(TFirst first, TSecond second)> Zip<TFirst, TSecond>(this IEnumerable<TFirst> first, IEnumerable<TSecond> second) Parameters Type Name Description IEnumerable <TFirst> first IEnumerable <TSecond> second Returns Type Description IEnumerable < ValueTuple <TFirst, TSecond>> Type Parameters Name Description TFirst TSecond Remarks If the sequences are of different lengths,"
},
"api/Recore.ObjectExtensions.html": {
"href": "api/Recore.ObjectExtensions.html",
"title": "Class ObjectExtensions | RecoreFX",
"keywords": "Class ObjectExtensions Helper methods for working with any object in .NET. Inheritance Object ObjectExtensions Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore Assembly : Recore.dll Syntax public static class ObjectExtensions Methods | Improve this Doc View Source Apply<T>(T, Action<T>) Invokes an action on an object and passes the object through. Declaration public static T Apply<T>(this T obj, Action<T> action) Parameters Type Name Description T obj Action <T> action Returns Type Description T Type Parameters Name Description T | Improve this Doc View Source Apply<T, TResult>(T, Func<T, TResult>) Invokes a function on an object. Declaration public static TResult Apply<T, TResult>(this T obj, Func<T, TResult> func) Parameters Type Name Description T obj Func <T, TResult> func Returns Type Description TResult Type Parameters Name Description T TResult Examples This method is useful for calling a function with postfix syntax: var syncClient = new ServiceCollection() .Apply(ConfigureServices) .Apply(x => x.BuildServiceProvider()) .Apply(x => x.GetService<SyncClient>()); It can also be used to simplify null-propagation logic when the ?. operator cannot be used: // Before var route = contentEndpoint is null ? null : $\"{contentEndpoint}?path={forwardSlashPath}\"; // After var route = contentEndpoint?.Apply(x => $\"{x}?path={forwardSlashPath}\"); | Improve this Doc View Source ApplyAsync<T>(Task<T>, AsyncAction<T>) Awaits a task, invokes an asynchronous action on the result, and passes the awaited task through. Declaration public static Task<T> ApplyAsync<T>(this Task<T> task, AsyncAction<T> action) Parameters Type Name Description Task <T> task AsyncAction <T> action Returns Type Description Task <T> Type Parameters Name Description T | Improve this Doc View Source ApplyAsync<T, TResult>(Task<T>, AsyncFunc<T, TResult>) Awaits a task and invokes an asynchronous function on a task. Declaration public static Task<TResult> ApplyAsync<T, TResult>(this Task<T> task, AsyncFunc<T, TResult> func) Parameters Type Name Description Task <T> task AsyncFunc <T, TResult> func Returns Type Description Task <TResult> Type Parameters Name Description T TResult | Improve this Doc View Source StaticCast<T>(T) Converts an object's type to T at compile time. Declaration public static T StaticCast<T>(this T obj) Parameters Type Name Description T obj Returns Type Description T Type Parameters Name Description T Remarks This method is analogous to static_cast in C++. In C#, casting is normally an unsafe operation: a failed cast will throw InvalidCastException . On the other hand, StaticCast<T>(T) will never throw at run time if it compiles. Examples Useful for overcoming those pesky variance issues: Task<IEnumerable<object>> GetObjectsAsync() { var result = new[] { \"hello\" }; // error CS0029 because the static type of `result` is an array, not an `IEnumerable` // return Task.FromResult(result); // 👍 return Task.FromResult(result.StaticCast<IEnumerable<object>>()); }"
},
"api/Recore.Of-1.html": {
"href": "api/Recore.Of-1.html",
"title": "Class Of<T> | RecoreFX",
"keywords": "Class Of<T> Abstract base class for defining types that alias an existing type. Inheritance Object Of<T> Implements IEquatable < Of <T>> Inherited Members Object.Equals(Object, Object) Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Recore Assembly : Recore.dll Syntax [JsonConverter(typeof(OfConverter))] public abstract class Of<T> : IEquatable<Of<T>> Type Parameters Name Description T Remarks Use Of<T> to create a strongly-typed \"alias\" of another type. You can use a using directive to create an alias for a type, but the scope of that alias is limited to that file. Furthermore, the alias is just that -- an alias -- not a separate type. So, an alias won't prevent errors like this: using Name = string; using Address = string; class Person { public Person(int age, Address address, Name name) { } } var person = new Person(22, \"Alice\", \"1 Microsoft Way\"); // oops! Note: as of C# 9, you can replace many use cases for Of<T> with record types: record Address(string Value); record Name(string Value); Of<T> is not marked with ObsoleteAttribute because records have some limitations that classes do not have. Also, Of<T> provides easy JSON serialization and implicit conversion to its wrapped type, which records do not provide. Examples class Address : Of<string> {} var address = new Address { Value = \"1 Microsoft Way\" }; Console.WriteLine(address); // prints \"1 Microsoft Way\" var address2 = new Address { Value = \"1 Microsoft Way\" }; Console.WriteLine(address == address2); // prints \"true\" You can add OfJsonAttribute so that the type is serialized in the same was as the T type: using System.Text.Json; [OfJson(typeof(JsonAddress), typeof(string))] class JsonAddress : Of<string> {} var jsonAddress = new JsonAddress { Value = \"1 Microsoft Way\" }; Console.WriteLine(JsonSerializer.Serialize(address)); // {\"value\":\"1 Microsoft Way\"} Console.WriteLine(JsonSerializer.Serialize(jsonAddress)); // \"1 Microsoft Way\" Properties | Improve this Doc View Source Value The underlying instance of the wrapped type. Declaration public T Value { get; } Property Value Type Description T Methods | Improve this Doc View Source Equals(Of<T>) Determines whether two instances of the type are equal. Declaration public bool Equals(Of<T> other) Parameters Type Name Description Of <T> other Returns Type Description Boolean Remarks Note that instances of two separate subtypes of Of<T> will compare equal to each other if their values are the same type and are equal. | Improve this Doc View Source Equals(Object) Determines whether this instance is equal to another object. Declaration public override bool Equals(object obj) Parameters Type Name Description Object obj Returns Type Description Boolean Overrides Object.Equals(Object) | Improve this Doc View Source GetHashCode() Returns the hash code for the underlying object. Declaration public override int GetHashCode() Returns Type Description Int32 Overrides Object.GetHashCode() | Improve this Doc View Source To<TOf>() Converts this Of<T> to another subtype of Of<T> with the same value of T . Declaration public TOf To<TOf>() where TOf : Of<T>, new() Returns Type Description TOf Type Parameters Name Description TOf | Improve this Doc View Source ToString() Returns the string representation for the underlying object. Declaration public override string ToString() Returns Type Description String Overrides Object.ToString() Operators | Improve this Doc View Source Equality(Of<T>, Of<T>) Determines whether two instances of the type are equal. Declaration public static bool operator ==(Of<T> lhs, Of<T> rhs) Parameters Type Name Description Of <T> lhs Of <T> rhs Returns Type Description Boolean | Improve this Doc View Source Implicit(Of<T> to T) Converts an instance of Of<T> to its inner type T . Declaration public static implicit operator T(Of<T> of) Parameters Type Name Description Of <T> of Returns Type Description T Remarks Of<T> is conceptually (though not in fact) a subtype of T . This conversion allows instances of Of<T> to work with methods out of the caller's control. | Improve this Doc View Source Inequality(Of<T>, Of<T>) Determines whether two instances of the type are not equal. Declaration public static bool operator !=(Of<T> lhs, Of<T> rhs) Parameters Type Name Description Of <T> lhs Of <T> rhs Returns Type Description Boolean Implements System.IEquatable<T> Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.OfJsonAttribute.html": {
"href": "api/Recore.OfJsonAttribute.html",
"title": "Class OfJsonAttribute | RecoreFX",
"keywords": "Class OfJsonAttribute Place on an subtype of Of<T> to serialize it to JSON as its underlying type. Inheritance Object Attribute JsonAttribute JsonConverterAttribute OfJsonAttribute Inherited Members JsonConverterAttribute.CreateConverter(Type) JsonConverterAttribute.ConverterType Attribute.Equals(Object) Attribute.GetCustomAttribute(Assembly, Type) Attribute.GetCustomAttribute(Assembly, Type, Boolean) Attribute.GetCustomAttribute(MemberInfo, Type) Attribute.GetCustomAttribute(MemberInfo, Type, Boolean) Attribute.GetCustomAttribute(Module, Type) Attribute.GetCustomAttribute(Module, Type, Boolean) Attribute.GetCustomAttribute(ParameterInfo, Type) Attribute.GetCustomAttribute(ParameterInfo, Type, Boolean) Attribute.GetCustomAttributes(Assembly) Attribute.GetCustomAttributes(Assembly, Boolean) Attribute.GetCustomAttributes(Assembly, Type) Attribute.GetCustomAttributes(Assembly, Type, Boolean) Attribute.GetCustomAttributes(MemberInfo) Attribute.GetCustomAttributes(MemberInfo, Boolean) Attribute.GetCustomAttributes(MemberInfo, Type) Attribute.GetCustomAttributes(MemberInfo, Type, Boolean) Attribute.GetCustomAttributes(Module) Attribute.GetCustomAttributes(Module, Boolean) Attribute.GetCustomAttributes(Module, Type) Attribute.GetCustomAttributes(Module, Type, Boolean) Attribute.GetCustomAttributes(ParameterInfo) Attribute.GetCustomAttributes(ParameterInfo, Boolean) Attribute.GetCustomAttributes(ParameterInfo, Type) Attribute.GetCustomAttributes(ParameterInfo, Type, Boolean) Attribute.GetHashCode() Attribute.IsDefaultAttribute() Attribute.IsDefined(Assembly, Type) Attribute.IsDefined(Assembly, Type, Boolean) Attribute.IsDefined(MemberInfo, Type) Attribute.IsDefined(MemberInfo, Type, Boolean) Attribute.IsDefined(Module, Type) Attribute.IsDefined(Module, Type, Boolean) Attribute.IsDefined(ParameterInfo, Type) Attribute.IsDefined(ParameterInfo, Type, Boolean) Attribute.Match(Object) Attribute.TypeId Object.Equals(Object, Object) Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore Assembly : Recore.dll Syntax [AttributeUsage(AttributeTargets.Class)] public sealed class OfJsonAttribute : JsonConverterAttribute Constructors | Improve this Doc View Source OfJsonAttribute(Type, Type) Initializes a new instance of OfJsonAttribute . Declaration public OfJsonAttribute(Type thisType, Type innerType) Parameters Type Name Description Type thisType Type innerType Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.Optional.html": {
"href": "api/Recore.Optional.html",
"title": "Class Optional | RecoreFX",
"keywords": "Class Optional Provides additional methods for Optional<T> . Inheritance Object Optional Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore Assembly : Recore.dll Syntax public static class Optional Methods | Improve this Doc View Source AwaitAsync<T>(Optional<Task<T>>) Converts an Optional<Task<T>> to a Task<Optional<T>> . Declaration public static Task<Optional<T>> AwaitAsync<T>(this Optional<Task<T>> optionalTask) Parameters Type Name Description Optional < Task <T>> optionalTask Returns Type Description Task < Optional <T>> Type Parameters Name Description T | Improve this Doc View Source Flatten<T>(Optional<Optional<T>>) Converts an Optional<Optional<T>> to an Optional<T> . Declaration public static Optional<T> Flatten<T>(this Optional<Optional<T>> optionalOptional) Parameters Type Name Description Optional < Optional <T>> optionalOptional Returns Type Description Optional <T> Type Parameters Name Description T | Improve this Doc View Source Flatten<T>(Optional<Nullable<T>>) Converts an Optional<Nullable<T>> to an Optional<T> . Declaration public static Optional<T> Flatten<T>(this Optional<T?> optionalNullable) where T : struct Parameters Type Name Description Optional < Nullable <T>> optionalNullable Returns Type Description Optional <T> Type Parameters Name Description T | Improve this Doc View Source If<T>(Boolean, T) Sets an optional value if a condition is true. Declaration public static Optional<T> If<T>(bool condition, T value) Parameters Type Name Description Boolean condition T value Returns Type Description Optional <T> Type Parameters Name Description T Remarks This method is useful for converting the TryParse pattern to an Optional<T> result. | Improve this Doc View Source If<T>(Boolean, Func<T>) Sets an optional value if a condition is true. Declaration public static Optional<T> If<T>(bool condition, Func<T> func) Parameters Type Name Description Boolean condition Func <T> func Returns Type Description Optional <T> Type Parameters Name Description T Remarks This method is useful for converting the TryParse pattern to an Optional<T> result. | Improve this Doc View Source Lift<T>(Action<T>) Converts a unary action to work with Optional<T> . Declaration public static Action<Optional<T>> Lift<T>(Action<T> action) Parameters Type Name Description Action <T> action Returns Type Description Action < Optional <T>> Type Parameters Name Description T | Improve this Doc View Source Lift<T, TResult>(Func<T, TResult>) Converts a unary function to work with Optional<T> . Declaration public static Func<Optional<T>, Optional<TResult>> Lift<T, TResult>(Func<T, TResult> func) Parameters Type Name Description Func <T, TResult> func Returns Type Description Func < Optional <T>, Optional <TResult>> Type Parameters Name Description T TResult | Improve this Doc View Source NonEmpty<T>(IEnumerable<Optional<T>>) Collects the non-empty values from the sequence. Declaration public static IEnumerable<T> NonEmpty<T>(this IEnumerable<Optional<T>> source) Parameters Type Name Description IEnumerable < Optional <T>> source Returns Type Description IEnumerable <T> Type Parameters Name Description T | Improve this Doc View Source Of<T>(T) Makes a value optional. Declaration public static Optional<T> Of<T>(T value) Parameters Type Name Description T value Returns Type Description Optional <T> Type Parameters Name Description T Remarks This is useful for type inference in cases where the implicit conversion can't be used, such as creating an Optional<T> and immediately invoking a method. It can also be passed as a delegate whereas the constructor can't be. | Improve this Doc View Source Of<T>(Nullable<T>) Converts a Nullable<T> to Optional<T> . Declaration public static Optional<T> Of<T>(T? value) where T : struct Parameters Type Name Description Nullable <T> value Returns Type Description Optional <T> Type Parameters Name Description T Remarks This is a special overload for nullable types to avoid ending up with Optional<T?> . For a value type such as Int32 , this method is equivalent to new Optional<int?>(x).Collapse() ."
},
"api/Recore.Optional-1.html": {
"href": "api/Recore.Optional-1.html",
"title": "Struct Optional<T> | RecoreFX",
"keywords": "Struct Optional<T> Provides type-safe access to a nullable value. Implements IEquatable < Optional <T>> Inherited Members Object.Equals(Object, Object) Object.GetType() Object.ReferenceEquals(Object, Object) Namespace : Recore Assembly : Recore.dll Syntax [JsonConverter(typeof(OptionalConverter))] public struct Optional<T> : IEquatable<Optional<T>> Type Parameters Name Description T Remarks Optional<T> differs from Nullable<T> in the following ways: Nullable<T> has syntactic sugar like the alias T? and the operators ?. and ?? Nullable<T> has some special-case behavior in the CLR for boxing and GetType() Nullable<T> works only with value types while Optional<T> works with both value and reference types Nullable<T> provides direct access to its value through Value , while Optional<T> requires access through its methods The last point is the most significant. Accessing the value directly through Value opens up the possibility for a NullReferenceException . With Optional<T> , once you have an optional value, all operations on it happen in an \"optional context.\" You can't get rid of Optional<T> until you do something to handle the null case such as by calling Switch<TResult>(Func<T, TResult>, Func<TResult>) or ValueOr(T) . Examples Here are a few examples for how to work with an optional value. Optional<T> has public constructors that you can use, but the easiest way to create an instance is to use the helper methods: Optional<string> opt; // Optional is a value type, so this defaults to empty opt = \"hello\"; // Creates an Optional with the value \"hello\" opt = Optional<string>.Empty; // Now it's empty again Switch() is the main way to work with Optional. It's akin to a switch statement. opt.Switch( x => Console.WriteLine(\"Message: \" + x), () => Console.WriteLine(\"No message\")); You can also return a value like a switch expression. In this case, both legs of the Switch() must return the same type. int messageLength = opt.Switch( x => x.Length, () => -1); But, a more idiomatic way to handle the above case is to use OnValue() . This will map Optional<T> to Optional<U> . If the original Optional<T> is empty, the new one will also be empty. Optional<int> messageLength = opt.OnValue(x => x.Length); We can work with the value procedurally, but this doesn't get us access to the value. For that, we can use AssertValue() . It will try to retrieve the value and throw InvalidOperationException if there's no value. if (opt.HasValue) { string value = opt.AssertValue(); } A safer way to get the value out is to use ValueOr() , which requires you to pass a fallback value. string message = opt.ValueOr(default); There's a special case where OnValue() and Then() can cause their callback to work differently than it does outside the Optional context. Consider these two calls: int? value = null; new Optional<int>(value ?? 0) new Optional<int?>(value).OnValue(x => x ?? 0) Normally, you'd expect these two lines to be equivalent for any function. But if value is null , they won't be the same. The same thing goes for Then() : Optional<int> NullableToOptional(int? n) => Optional.Of(n ?? 0); NullableToOptional(value) new Optional<int?>(value).Then(NullableToOptional) The problem is that \"null coalescing\" operations (by which I mean any function that turns null into a non- null value, including the ?? operator) won't work as expected when passed through Optional<T> . This is because they will never receive null as an input. (A note to functional-programming aficionados: the first example has implications for associativity. Passing a composed function to OnValue() may produce a different result than two separate OnValue() calls if null coalescing is involved. The second example is the monad law of left identity.) Since any reference type can be null , there's no way to fix it except to avoid it. Just know that you can't perform null-coalescing inside of an Optional context . Rather, use Optional 's own operations. Every example I can think of stands out as a bug if you examine it under this principle. For more information, this writeup explores the issue in the context of Java's optional type. Constructors | Improve this Doc View Source Optional(T) Creates an Optional<T> with a value. Declaration public Optional(T value) Parameters Type Name Description T value Remarks If null is passed for value , then the Optional<T> is considered empty. Properties | Improve this Doc View Source Empty Creates an Optional<T> without a value. Declaration public static Optional<T> Empty { get; } Property Value Type Description Optional <T> Remarks While an empty Optional<T> can also be created by calling the default constructor or passing null to the constructor, Empty is more expressive, making the absence of a value more obvious. | Improve this Doc View Source HasValue Indicates whether the Optional<T> was created with a value. Declaration public bool HasValue { get; } Property Value Type Description Boolean Methods | Improve this Doc View Source AssertValue() Extracts the value or throws an InvalidOperationException if the Optional<T> is empty. Declaration public T AssertValue() Returns Type Description T | Improve this Doc View Source Equals(Optional<T>) Determines whether this instance and another Optional<T> have the same values. Declaration public bool Equals(Optional<T> other) Parameters Type Name Description Optional <T> other Returns Type Description Boolean | Improve this Doc View Source Equals(Optional<T>, IEqualityComparer<T>) Determines whether this instance and another Optional<T> have the same values using the given IEqualityComparer<T> . Declaration public bool Equals(Optional<T> other, IEqualityComparer<T> comparer) Parameters Type Name Description Optional <T> other IEqualityComparer <T> comparer Returns Type Description Boolean | Improve this Doc View Source Equals(Object) Determines whether this instance and another object, which must also be an Optional<T> , have the same value. Declaration public override bool Equals(object obj) Parameters Type Name Description Object obj Returns Type Description Boolean Overrides ValueType.Equals(Object) | Improve this Doc View Source GetHashCode() Returns the hash code for the underlying type or zero if there is no value. Declaration public override int GetHashCode() Returns Type Description Int32 Overrides ValueType.GetHashCode() | Improve this Doc View Source IfValue(Action<T>) Takes an action only if the Optional<T> has a value. Declaration public void IfValue(Action<T> onValue) Parameters Type Name Description Action <T> onValue | Improve this Doc View Source OnValue<TResult>(Func<T, TResult>) Maps a function over the Optional<T> 's value, or propagates Empty . Declaration public Optional<TResult> OnValue<TResult>(Func<T, TResult> f) Parameters Type Name Description Func <T, TResult> f Returns Type Description Optional <TResult> Type Parameters Name Description TResult | Improve this Doc View Source Switch(Action<T>, Action) Chooses an action to take depending on whether the Optional<T> has a value. Declaration public void Switch(Action<T> onValue, Action onEmpty) Parameters Type Name Description Action <T> onValue Called when the Optional<T> has a value. Action onEmpty Called when the Optional<T> does not have a value. | Improve this Doc View Source Switch<TResult>(Func<T, TResult>, Func<TResult>) Chooses a function to call depending on whether the Optional<T> has a value. Declaration public TResult Switch<TResult>(Func<T, TResult> onValue, Func<TResult> onEmpty) Parameters Type Name Description Func <T, TResult> onValue Called when the Optional<T> has a value. Func <TResult> onEmpty Called when the Optional<T> does not have a value. Returns Type Description TResult Result of the function that was called. Type Parameters Name Description TResult | Improve this Doc View Source Then<TResult>(Func<T, Optional<TResult>>) Chains another Optional<T> -producing operation onto the result of another. Declaration public Optional<TResult> Then<TResult>(Func<T, Optional<TResult>> f) Parameters Type Name Description Func <T, Optional <TResult>> f Returns Type Description Optional <TResult> Type Parameters Name Description TResult Remarks This is a monad bind operation. Conceptually, it is the same as passing f to OnValue<TResult>(Func<T, TResult>) and then \"flattening\" the Optionlt;Optional< T >> into an Optional< T > . (Note that Optionlt;Optional< T >> is not a valid Optional<T> because of the type constraint where T : class .) | Improve this Doc View Source ToEnumerable() Converts an optional value to an enumerable. The enumerable will have either zero or one elements. Declaration public IEnumerable<T> ToEnumerable() Returns Type Description IEnumerable <T> | Improve this Doc View Source ToString() Returns the value's string representation, or a localized \"none\" message. Declaration public override string ToString() Returns Type Description String Overrides ValueType.ToString() | Improve this Doc View Source ValueOr(T) Extracts the value with a fallback if the Optional<T> is empty. Declaration public T ValueOr(T fallback) Parameters Type Name Description T fallback Returns Type Description T Operators | Improve this Doc View Source Equality(Optional<T>, Optional<T>) Determines whether two instances of Optional<T> have the same value. Declaration public static bool operator ==(Optional<T> lhs, Optional<T> rhs) Parameters Type Name Description Optional <T> lhs Optional <T> rhs Returns Type Description Boolean | Improve this Doc View Source Explicit(Optional<T> to T) Casts this instance to its underlying value or the default value for the underlying type. Declaration public static explicit operator T(Optional<T> optional) Parameters Type Name Description Optional <T> optional Returns Type Description T | Improve this Doc View Source Implicit(T to Optional<T>) Converts an instance of a type to an optional value. Declaration public static implicit operator Optional<T>(T value) Parameters Type Name Description T value Returns Type Description Optional <T> | Improve this Doc View Source Inequality(Optional<T>, Optional<T>) Determines whether two instances of Optional<T> have different values. Declaration public static bool operator !=(Optional<T> lhs, Optional<T> rhs) Parameters Type Name Description Optional <T> lhs Optional <T> rhs Returns Type Description Boolean Implements System.IEquatable<T> Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.RelativeUri.html": {
"href": "api/Recore.RelativeUri.html",
"title": "Class RelativeUri | RecoreFX",
"keywords": "Class RelativeUri Represents a relative URI. Inheritance Object Uri RelativeUri Implements ISerializable Inherited Members Uri.SchemeDelimiter Uri.UriSchemeFile Uri.UriSchemeFtp Uri.UriSchemeGopher Uri.UriSchemeHttp Uri.UriSchemeHttps Uri.UriSchemeMailto Uri.UriSchemeNetPipe Uri.UriSchemeNetTcp Uri.UriSchemeNews Uri.UriSchemeNntp Uri.Canonicalize() Uri.CheckHostName(String) Uri.CheckSchemeName(String) Uri.CheckSecurity() Uri.Compare(Uri, Uri, UriComponents, UriFormat, StringComparison) Uri.Equals(Object) Uri.Escape() Uri.EscapeDataString(String) Uri.EscapeString(String) Uri.EscapeUriString(String) Uri.FromHex(Char) Uri.GetComponents(UriComponents, UriFormat) Uri.GetHashCode() Uri.GetLeftPart(UriPartial) Uri.GetObjectData(SerializationInfo, StreamingContext) Uri.HexEscape(Char) Uri.HexUnescape(String, Int32) Uri.IsBadFileSystemCharacter(Char) Uri.IsBaseOf(Uri) Uri.IsExcludedCharacter(Char) Uri.IsHexDigit(Char) Uri.IsHexEncoding(String, Int32) Uri.IsReservedCharacter(Char) Uri.IsWellFormedOriginalString() Uri.IsWellFormedUriString(String, UriKind) Uri.MakeRelative(Uri) Uri.MakeRelativeUri(Uri) Uri.Parse() Uri.ISerializable.GetObjectData(SerializationInfo, StreamingContext) Uri.ToString() Uri.TryCreate(String, UriKind, Uri) Uri.TryCreate(Uri, String, Uri) Uri.TryCreate(Uri, Uri, Uri) Uri.Unescape(String) Uri.UnescapeDataString(String) Uri.AbsolutePath Uri.AbsoluteUri Uri.Authority Uri.DnsSafeHost Uri.Fragment Uri.Host Uri.HostNameType Uri.IdnHost Uri.IsAbsoluteUri Uri.IsDefaultPort Uri.IsFile Uri.IsLoopback Uri.IsUnc Uri.LocalPath Uri.OriginalString Uri.PathAndQuery Uri.Port Uri.Query Uri.Scheme Uri.Segments Uri.UserEscaped Uri.UserInfo Object.Equals(Object, Object) Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Recore Assembly : Recore.dll Syntax [JsonConverter(typeof(RelativeUriConverter))] public class RelativeUri : Uri, ISerializable Constructors | Improve this Doc View Source RelativeUri(String) Initializes a new instance of RelativeUri with the given URI. Declaration public RelativeUri(string uriString) Parameters Type Name Description String uriString Methods | Improve this Doc View Source TryCreate(String, out RelativeUri) Creates a new RelativeUri . Does not throw an exception if the RelativeUri cannot be created. Declaration public static bool TryCreate(string uriString, out RelativeUri result) Parameters Type Name Description String uriString RelativeUri result Returns Type Description Boolean Implements System.Runtime.Serialization.ISerializable Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>) UriExtensions.AsAbsoluteUri(Uri) UriExtensions.AsRelativeUri(Uri)"
},
"api/Recore.Result.AsyncCatcher-1.html": {
"href": "api/Recore.Result.AsyncCatcher-1.html",
"title": "Class Result.AsyncCatcher<TValue> | RecoreFX",
"keywords": "Class Result.AsyncCatcher<TValue> Wraps a function to be executed and converted to Result<TValue, TError> . Inheritance Object Result.AsyncCatcher<TValue> Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore Assembly : Recore.dll Syntax public sealed class AsyncCatcher<TValue> Type Parameters Name Description TValue Methods | Improve this Doc View Source CatchAsync<TException>() Executes the stored function and catches exceptions of the given type. Declaration public Task<Result<TValue, TException>> CatchAsync<TException>() where TException : Exception Returns Type Description Task < Result <TValue, TException>> Type Parameters Name Description TException | Improve this Doc View Source CatchAsync<TException, TResult>(AsyncFunc<TException, TResult>) Executes the stored function and catches exceptions of the given type matching the given predicate. Declaration public Task<Result<TValue, TResult>> CatchAsync<TException, TResult>(AsyncFunc<TException, TResult> onException) where TException : Exception Parameters Type Name Description AsyncFunc <TException, TResult> onException Returns Type Description Task < Result <TValue, TResult>> Type Parameters Name Description TException TResult Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.Result.Catcher-1.html": {
"href": "api/Recore.Result.Catcher-1.html",
"title": "Class Result.Catcher<TValue> | RecoreFX",
"keywords": "Class Result.Catcher<TValue> Wraps a function to be executed and converted to Result<TValue, TError> . Inheritance Object Result.Catcher<TValue> Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore Assembly : Recore.dll Syntax public sealed class Catcher<TValue> Type Parameters Name Description TValue Methods | Improve this Doc View Source Catch<TException>() Executes the stored function and catches exceptions of the given type. Declaration public Result<TValue, TException> Catch<TException>() where TException : Exception Returns Type Description Result <TValue, TException> Type Parameters Name Description TException | Improve this Doc View Source Catch<TException, TMapped>(Func<TException, TMapped>) Executes the stored function and catches exceptions of the given type matching the given predicate. Declaration public Result<TValue, TMapped> Catch<TException, TMapped>(Func<TException, TMapped> onException) where TException : Exception Parameters Type Name Description Func <TException, TMapped> onException Returns Type Description Result <TValue, TMapped> Type Parameters Name Description TException TMapped Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.Result.html": {
"href": "api/Recore.Result.html",
"title": "Class Result | RecoreFX",
"keywords": "Class Result Provides additional methods for Result<TValue, TError> . Inheritance Object Result Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore Assembly : Recore.dll Syntax public static class Result Methods | Improve this Doc View Source Collapse<T>(Result<T, T>) Retrieves the value of a Result<TValue, TError> when TValue and TError are the same. Declaration public static T Collapse<T>(this Result<T, T> result) Parameters Type Name Description Result <T, T> result Returns Type Description T Type Parameters Name Description T | Improve this Doc View Source Failure<TValue, TError>(TError) Creates a failed result. Declaration public static Result<TValue, TError> Failure<TValue, TError>(TError error) Parameters Type Name Description TError error Returns Type Description Result <TValue, TError> Type Parameters Name Description TValue TError | Improve this Doc View Source Failures<TValue, TError>(IEnumerable<Result<TValue, TError>>) Collects all the errors from failed results from the sequence. Declaration public static IEnumerable<TError> Failures<TValue, TError>(this IEnumerable<Result<TValue, TError>> source) Parameters Type Name Description IEnumerable < Result <TValue, TError>> source Returns Type Description IEnumerable <TError> Type Parameters Name Description TValue TError | Improve this Doc View Source Flatten<TValue, TError>(Result<Result<TValue, TError>, TError>) Converts a Result<Result<TValue, TError>, TError> to a Result<TValue, TError> . Declaration public static Result<TValue, TError> Flatten<TValue, TError>(this Result<Result<TValue, TError>, TError> resultResult) Parameters Type Name Description Result < Result <TValue, TError>, TError> resultResult Returns Type Description Result <TValue, TError> Type Parameters Name Description TValue TError | Improve this Doc View Source Success<TValue, TError>(TValue) Creates a successful result. Declaration public static Result<TValue, TError> Success<TValue, TError>(TValue value) Parameters Type Name Description TValue value Returns Type Description Result <TValue, TError> Type Parameters Name Description TValue TError | Improve this Doc View Source Successes<TValue, TError>(IEnumerable<Result<TValue, TError>>) Collects all the values of successful results from the sequence. Declaration public static IEnumerable<TValue> Successes<TValue, TError>(this IEnumerable<Result<TValue, TError>> source) Parameters Type Name Description IEnumerable < Result <TValue, TError>> source Returns Type Description IEnumerable <TValue> Type Parameters Name Description TValue TError | Improve this Doc View Source Try<TValue>(Func<TValue>) Suspends a function to be executed by Catch<TException>() . Declaration public static Result.Catcher<TValue> Try<TValue>(Func<TValue> func) Parameters Type Name Description Func <TValue> func Returns Type Description Result.Catcher <TValue> Type Parameters Name Description TValue | Improve this Doc View Source TryAsync<TValue>(AsyncFunc<TValue>) Suspends a function to be executed by CatchAsync<TException>() . Declaration public static Result.AsyncCatcher<TValue> TryAsync<TValue>(AsyncFunc<TValue> func) Parameters Type Name Description AsyncFunc <TValue> func Returns Type Description Result.AsyncCatcher <TValue> Type Parameters Name Description TValue Remarks TryAsync<TValue>(AsyncFunc<TValue>) must be used instead of Try<TValue>(Func<TValue>) to ensure exceptions are caught properly with async code."
},
"api/Recore.Result-2.html": {
"href": "api/Recore.Result-2.html",
"title": "Class Result<TValue, TError> | RecoreFX",
"keywords": "Class Result<TValue, TError> Represents the result of an operation that can be successful or failed. Inheritance Object Result<TValue, TError> Implements IEquatable < Result <TValue, TError>> Inherited Members Object.Equals(Object, Object) Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Namespace : Recore Assembly : Recore.dll Syntax [JsonConverter(typeof(ResultConverter))] public sealed class Result<TValue, TError> : IEquatable<Result<TValue, TError>> Type Parameters Name Description TValue TError Remarks When working with System.Text.Json , deserializing into Result<TValue, TError> can be ambiguous. The default deserialization behavior will try first to deserialize as TValue , and then as TError . But, this may return the unintended type if the value deserializer can successfully deserialize the JSON representation of the error. A common case is when both TValue and TError are POCOs. In that case, Result<TValue, TError> will always deserialize as TValue , filling in default values for any missing properties. For example: class Person { public string Name { get; set; } public int Age { get; set; } } class Address { public string Street { get; set; } public string Zip { get; set; } } // Deserializes as a `Person`! JsonSerializer.Deserialize<Result<Person, Address>>(\"{\\\"Street\\\":\\\"123 Main St\\\",\\\"Zip\\\":\\\"12345\\\"}\") You can use OverrideResultConverter<TValue, TError> to specify how to choose between TValue and TError based on the properties in the JSON: // Look at the JSON to decide which type we have options.Converters.Add(new OverrideResultConverter<Person, Address>( deserializeAsLeft: json => json.TryGetProperty(\"Street\", out JsonElement _))); // Deserializes correctly JsonSerializer.Deserialize<Result<Person, Address>>(\"{\\\"Street\\\":\\\"123 Main St\\\",\\\"Zip\\\":\\\"12345\\\"}\", options) Examples Result<TValue, TError> is basically a reskin of Either<TLeft, TRight> with some additional semantics. To explain the use case, let's think about exception-based and status-code-based error handling. (If you haven't read it before, I strongly recommend Joe Duffy's blog post on the topic .) For an example of exception-based handling, think of Parse(String) . For an example of exception-based handling, think of Int32.TryParse(String, out Int32) . Basically, the debate looks like this: Pros Cons Status codes Low perf hit Better choice for when errors are expected, like when validating untrusted data Mess up the method signature Can be ignored or forgotten about Exceptions Let code focus on happy-path logic and push error handling up into another layer Can't be ignored, preventing unsafe execution of the program Horribly slow when thrown (dominated by collecting the stack trace) Can be forgotten about, leading to your users seeing internal error messages or introducing bugs in the error flow As you can tell, exceptions are great for handling fatal errors. But what about recoverable errors? Status codes are a better choice, but are a bit primitive. This is where Result<TValue, TError> comes in. It has the same pros as status codes, but addresses the cons: Less disruptive to the method signature; just return Result<TValue, TError> Can't get to the value unless you handle the error case For an example, imagine you're calling HttpClient.GetAsync() to fetch some JSON data and deserialize it. Its signature is Task<HttpResponseMessage> GetAsync(string requestUri); With exceptions, you could implement it like this: async Task<Person> GetPersonAsync(int id) { var response = await httpClient.GetAsync($\"/api/v1/person/{id}\"); if (!response.IsSuccessStatusCode) { throw new HttpRequestException(response.StatusCode.ToString()); } var json = await response.Content.ReadAsStringAsync(); return JsonSerializer.Deserialize<Person>(json); } But HTTP calls fail for all kinds of reasons. Who handles that exception? How do you decide to retry? How do you report the error to the user? A better choice is to go with Result<TValue, TError> : async Task<Result<Person, HttpStatusCode>> GetPersonAsync(int id) { var response = await httpClient.GetAsync($\"/api/v1/person/{id}\"); if (response.IsSuccessStatusCode) { var json = await response.Content.ReadAsStringAsync(); var person = JsonSerializer.Deserialize<Person>(json); return Result.Success<Person, HttpStatusCode>(person); } else { return Result.Failure<Person, HttpStatusCode>(response.StatusCode); } } If you're working with an API that returns a special error response in case of errors (such as GitHub) , you can even do this: async Task<Result<Person, Error>> GetPersonAsync(int id) { // ... else { var json = await response.Content.ReadAsStringAsync(); var error = JsonSerializer.Deserialize<Error>(json); return Result.Failure<Person, HttpStatusCode>(error); } } Anyway, let's say we just pass on the status code. Downstream code can then handle the error like this: async Task<bool> GetPersonAndPrint(int id) { bool retry = false; var personResult = await GetPersonAsync(id); personResult.Switch( person => Console.WriteLine(person), status => { if ((int)status >= 500) { retry = true; } else { Console.Error.WriteLine($\"Fatal error: {status}\"); } }); return retry; } It also makes it easy to build up an error context as you go along rather than terminating immediately ( see this code ): Result<IBlob, IBlob>[] results = await Task.WhenAll(blobsToWrite.Select(blob => Result.TryAsync(async () => { await WriteBlobAsync(blob); return blob; }) .CatchAsync((Exception e) => { Console.Error.WriteLine(e); return Task.FromResult(blob); }))); List<IBlob> successes = results.Successes().ToList(); List<IBlob> failures = results.Failures().ToList(); Constructors | Improve this Doc View Source Result(TValue) Constructs an instance of the type from a value of TValue . Declaration public Result(TValue value) Parameters Type Name Description TValue value | Improve this Doc View Source Result(TError) Constructs an instance of the type from a value of TError . Declaration public Result(TError error) Parameters Type Name Description TError error Properties | Improve this Doc View Source IsSuccessful Indicates whether the result is successful. Declaration public bool IsSuccessful { get; } Property Value Type Description Boolean Methods | Improve this Doc View Source Equals(Result<TValue, TError>) Compares two instances of Result<TValue, TError> for equality. Declaration public bool Equals(Result<TValue, TError> other) Parameters Type Name Description Result <TValue, TError> other Returns Type Description Boolean Remarks Equality is defined as both objects' underlying values or errors being equal. | Improve this Doc View Source Equals(Result<TValue, TError>, IEqualityComparer<TValue>, IEqualityComparer<TError>) Compares two instances of Result<TValue, TError> for equality using the given IEqualityComparer<T> . Declaration public bool Equals(Result<TValue, TError> other, IEqualityComparer<TValue> valueComparer, IEqualityComparer<TError> errorComparer) Parameters Type Name Description Result <TValue, TError> other IEqualityComparer <TValue> valueComparer IEqualityComparer <TError> errorComparer Returns Type Description Boolean | Improve this Doc View Source Equals(Object) Compares this Result<TValue, TError> to another object for equality. Declaration public override bool Equals(object obj) Parameters Type Name Description Object obj Returns Type Description Boolean Overrides Object.Equals(Object) Remarks Two Result<TValue, TError> s are equal only if they have the same type parameters in the same order. For example, an Result<int, string> and an Result<string, int> will always be nonequal. | Improve this Doc View Source GetError() Converts Result<TValue, TError> to Optional<TError> Declaration public Optional<TError> GetError() Returns Type Description Optional <TError> | Improve this Doc View Source GetHashCode() Returns the hash code of the underlying value. Declaration public override int GetHashCode() Returns Type Description Int32 Overrides Object.GetHashCode() | Improve this Doc View Source GetValue() Converts Result<TValue, TError> to Optional<TValue> Declaration public Optional<TValue> GetValue() Returns Type Description Optional <TValue> | Improve this Doc View Source IfError(Action<TError>) Takes an action only if the the result is failed. Declaration public void IfError(Action<TError> onError) Parameters Type Name Description Action <TError> onError | Improve this Doc View Source IfValue(Action<TValue>) Takes an action only if the result is successful. Declaration public void IfValue(Action<TValue> onValue) Parameters Type Name Description Action <TValue> onValue | Improve this Doc View Source OnError<TResult>(Func<TError, TResult>) Maps a function over the Result<TValue, TError> only if the result is failed. Declaration public Result<TValue, TResult> OnError<TResult>(Func<TError, TResult> onError) Parameters Type Name Description Func <TError, TResult> onError Returns Type Description Result <TValue, TResult> Type Parameters Name Description TResult | Improve this Doc View Source OnValue<TResult>(Func<TValue, TResult>) Maps a function over the Result<TValue, TError> only if the result is successful. Declaration public Result<TResult, TError> OnValue<TResult>(Func<TValue, TResult> onValue) Parameters Type Name Description Func <TValue, TResult> onValue Returns Type Description Result <TResult, TError> Type Parameters Name Description TResult | Improve this Doc View Source Switch(Action<TValue>, Action<TError>) Takes one of two actions depending on whether the result is successful. Declaration public void Switch(Action<TValue> onValue, Action<TError> onError) Parameters Type Name Description Action <TValue> onValue Action <TError> onError | Improve this Doc View Source Switch<T>(Func<TValue, T>, Func<TError, T>) Calls one of two functions depending on whether the result is successful. Declaration public T Switch<T>(Func<TValue, T> onValue, Func<TError, T> onError) Parameters Type Name Description Func <TValue, T> onValue Func <TError, T> onError Returns Type Description T Type Parameters Name Description T | Improve this Doc View Source Then<TResult>(Func<TValue, Result<TResult, TError>>) Chains another Result<TValue, TError> -producing operation from another. Declaration public Result<TResult, TError> Then<TResult>(Func<TValue, Result<TResult, TError>> f) Parameters Type Name Description Func <TValue, Result <TResult, TError>> f Returns Type Description Result <TResult, TError> Type Parameters Name Description TResult Remarks This is a monad bind operation. Conceptually, it is the same as passing f to OnValue<TResult>(Func<TValue, TResult>) and then \"flattening\" the result. | Improve this Doc View Source ToString() Returns the string representation of the underlying value or error. Declaration public override string ToString() Returns Type Description String Overrides Object.ToString() Operators | Improve this Doc View Source Equality(Result<TValue, TError>, Result<TValue, TError>) Determines whether two instances of Result<TValue, TError> have the same value. Declaration public static bool operator ==(Result<TValue, TError> lhs, Result<TValue, TError> rhs) Parameters Type Name Description Result <TValue, TError> lhs Result <TValue, TError> rhs Returns Type Description Boolean | Improve this Doc View Source Implicit(TValue to Result<TValue, TError>) Converts an instance of a type to an Result<TValue, TError> . Declaration public static implicit operator Result<TValue, TError>(TValue value) Parameters Type Name Description TValue value Returns Type Description Result <TValue, TError> | Improve this Doc View Source Implicit(TError to Result<TValue, TError>) Converts an instance of a type to an Result<TValue, TError> . Declaration public static implicit operator Result<TValue, TError>(TError error) Parameters Type Name Description TError error Returns Type Description Result <TValue, TError> | Improve this Doc View Source Inequality(Result<TValue, TError>, Result<TValue, TError>) Determines whether two instances of Result<TValue, TError> have different values. Declaration public static bool operator !=(Result<TValue, TError> lhs, Result<TValue, TError> rhs) Parameters Type Name Description Result <TValue, TError> lhs Result <TValue, TError> rhs Returns Type Description Boolean Implements System.IEquatable<T> Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.Security.Cryptography.html": {
"href": "api/Recore.Security.Cryptography.html",
"title": "Namespace Recore.Security.Cryptography | RecoreFX",
"keywords": "Namespace Recore.Security.Cryptography Classes SecureCompare Provides methods for securely comparing objects."
},
"api/Recore.Security.Cryptography.SecureCompare.html": {
"href": "api/Recore.Security.Cryptography.SecureCompare.html",
"title": "Class SecureCompare | RecoreFX",
"keywords": "Class SecureCompare Provides methods for securely comparing objects. Inheritance Object SecureCompare Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore.Security.Cryptography Assembly : Recore.dll Syntax public static class SecureCompare Methods | Improve this Doc View Source TimeInvariantEquals(Byte[], Byte[]) Checks two byte arrays for equality without early termination. Declaration public static bool TimeInvariantEquals(byte[] lhs, byte[] rhs) Parameters Type Name Description Byte [] lhs Byte [] rhs Returns Type Description Boolean Remarks This method is used to guard against timing attacks . When checking untrusted input against a secret, using a regular element-by-element equality method such as Equals(String) is insecure. For example, suppose you are checking whether an incoming request's signature matches what you expect. In this case, you hash the request payload with your own private key and compare that to the actual signature. If the comparison stops at the first unmatched element in the sequence, an attacker can time the comparison with a high-resolution timer and infer how many elements they guessed correctly. This method assumes that the length of the sequences are equal, such as two strings processed by a hashing algorithm. If the length of the sequence is considered a secret, this method should not be used as it will leak that information in a timing attack."
},
"api/Recore.Text.Json.Serialization.Converters.html": {
"href": "api/Recore.Text.Json.Serialization.Converters.html",
"title": "Namespace Recore.Text.Json.Serialization.Converters | RecoreFX",
"keywords": "Namespace Recore.Text.Json.Serialization.Converters Classes OverrideEitherConverter<TLeft, TRight> Converts Either<TLeft, TRight> to and from JSON. Register this converter to override the default deserialization behavior. OverrideResultConverter<TValue, TError> Converts Result<TValue, TError> to and from JSON. Register this converter to override the default deserialization behavior."
},
"api/Recore.Text.Json.Serialization.Converters.OverrideEitherConverter-2.html": {
"href": "api/Recore.Text.Json.Serialization.Converters.OverrideEitherConverter-2.html",
"title": "Class OverrideEitherConverter<TLeft, TRight> | RecoreFX",
"keywords": "Class OverrideEitherConverter<TLeft, TRight> Converts Either<TLeft, TRight> to and from JSON. Register this converter to override the default deserialization behavior. Inheritance Object JsonConverter JsonConverter < Either <TLeft, TRight>> OverrideEitherConverter<TLeft, TRight> Inherited Members JsonConverter<Either<TLeft, TRight>>.CanConvert(Type) JsonConverter<Either<TLeft, TRight>>.Read(Utf8JsonReader, Type, JsonSerializerOptions) JsonConverter<Either<TLeft, TRight>>.Write(Utf8JsonWriter, Either<TLeft, TRight>, JsonSerializerOptions) JsonConverter<Either<TLeft, TRight>>.HandleNull JsonConverter.CanConvert(Type) Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore.Text.Json.Serialization.Converters Assembly : Recore.dll Syntax public sealed class OverrideEitherConverter<TLeft, TRight> : JsonConverter<Either<TLeft, TRight>> Type Parameters Name Description TLeft TRight Remarks This converter is made to be used with a closed type and registered through Converters . It is not returned by Recore.Text.Json.Serialization.Converters.EitherConverter.CreateConverter(System.Type,System.Text.Json.JsonSerializerOptions) . Constructors | Improve this Doc View Source OverrideEitherConverter(Func<JsonElement, Boolean>) Initializes an instance of OverrideEitherConverter<TLeft, TRight> . Declaration public OverrideEitherConverter(Func<JsonElement, bool> deserializeAsLeft) Parameters Type Name Description Func < JsonElement , Boolean > deserializeAsLeft A delegate that takes a JsonElement representing some JSON and returns whether it should be deserialized as TLeft or TRight . It should return true for TLeft and false for TRight . Methods | Improve this Doc View Source Read(ref Utf8JsonReader, Type, JsonSerializerOptions) Deserializes JSON into Either<TLeft, TRight> . This method will call the delegate passed to the constructor to determine how to deserialize the JSON. Declaration public override Either<TLeft, TRight> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) Parameters Type Name Description Utf8JsonReader reader Type typeToConvert JsonSerializerOptions options Returns Type Description Either <TLeft, TRight> Overrides System.Text.Json.Serialization.JsonConverter<Recore.Either<TLeft, TRight>>.Read(System.Text.Json.Utf8JsonReader, System.Type, System.Text.Json.JsonSerializerOptions) | Improve this Doc View Source Write(Utf8JsonWriter, Either<TLeft, TRight>, JsonSerializerOptions) Serializes Either<TLeft, TRight> as JSON. Declaration public override void Write(Utf8JsonWriter writer, Either<TLeft, TRight> value, JsonSerializerOptions options) Parameters Type Name Description Utf8JsonWriter writer Either <TLeft, TRight> value JsonSerializerOptions options Overrides System.Text.Json.Serialization.JsonConverter<Recore.Either<TLeft, TRight>>.Write(System.Text.Json.Utf8JsonWriter, Recore.Either<TLeft, TRight>, System.Text.Json.JsonSerializerOptions) Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.Text.Json.Serialization.Converters.OverrideResultConverter-2.html": {
"href": "api/Recore.Text.Json.Serialization.Converters.OverrideResultConverter-2.html",
"title": "Class OverrideResultConverter<TValue, TError> | RecoreFX",
"keywords": "Class OverrideResultConverter<TValue, TError> Converts Result<TValue, TError> to and from JSON. Register this converter to override the default deserialization behavior. Inheritance Object JsonConverter JsonConverter < Result <TValue, TError>> OverrideResultConverter<TValue, TError> Inherited Members JsonConverter<Result<TValue, TError>>.CanConvert(Type) JsonConverter<Result<TValue, TError>>.Read(Utf8JsonReader, Type, JsonSerializerOptions) JsonConverter<Result<TValue, TError>>.Write(Utf8JsonWriter, Result<TValue, TError>, JsonSerializerOptions) JsonConverter<Result<TValue, TError>>.HandleNull JsonConverter.CanConvert(Type) Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore.Text.Json.Serialization.Converters Assembly : Recore.dll Syntax public sealed class OverrideResultConverter<TValue, TError> : JsonConverter<Result<TValue, TError>> Type Parameters Name Description TValue TError Remarks This converter is made to be used with a closed type and registered through Converters . It is not returned by Recore.Text.Json.Serialization.Converters.ResultConverter.CreateConverter(System.Type,System.Text.Json.JsonSerializerOptions) . Constructors | Improve this Doc View Source OverrideResultConverter(Func<JsonElement, Boolean>) Initializes an instance of OverrideResultConverter<TValue, TError> . Declaration public OverrideResultConverter(Func<JsonElement, bool> deserializeAsValue) Parameters Type Name Description Func < JsonElement , Boolean > deserializeAsValue A delegate that takes a JsonElement representing some JSON and returns whether it should be deserialized as TValue or TError . It should return true for TValue and false for TError . Methods | Improve this Doc View Source Read(ref Utf8JsonReader, Type, JsonSerializerOptions) Deserializes JSON into Result<TValue, TError> . This method will call the delegate passed to the constructor to determine how to deserialize the JSON. Declaration public override Result<TValue, TError> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) Parameters Type Name Description Utf8JsonReader reader Type typeToConvert JsonSerializerOptions options Returns Type Description Result <TValue, TError> Overrides System.Text.Json.Serialization.JsonConverter<Recore.Result<TValue, TError>>.Read(System.Text.Json.Utf8JsonReader, System.Type, System.Text.Json.JsonSerializerOptions) | Improve this Doc View Source Write(Utf8JsonWriter, Result<TValue, TError>, JsonSerializerOptions) Serializes Result<TValue, TError> as JSON. Declaration public override void Write(Utf8JsonWriter writer, Result<TValue, TError> value, JsonSerializerOptions options) Parameters Type Name Description Utf8JsonWriter writer Result <TValue, TError> value JsonSerializerOptions options Overrides System.Text.Json.Serialization.JsonConverter<Recore.Result<TValue, TError>>.Write(System.Text.Json.Utf8JsonWriter, Recore.Result<TValue, TError>, System.Text.Json.JsonSerializerOptions) Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.Threading.Tasks.html": {
"href": "api/Recore.Threading.Tasks.html",
"title": "Namespace Recore.Threading.Tasks | RecoreFX",
"keywords": "Namespace Recore.Threading.Tasks Classes TaskExtensions Provides additional methods for working with tasks."
},
"api/Recore.Threading.Tasks.TaskExtensions.html": {
"href": "api/Recore.Threading.Tasks.TaskExtensions.html",
"title": "Class TaskExtensions | RecoreFX",
"keywords": "Class TaskExtensions Provides additional methods for working with tasks. Inheritance Object TaskExtensions Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore.Threading.Tasks Assembly : Recore.dll Syntax public static class TaskExtensions Methods | Improve this Doc View Source Synchronize(Task) Blocks the current thread until the task completes. Declaration public static void Synchronize(this Task task) Parameters Type Name Description Task task Remarks If task is terminated by an exception, that exception will be rethrown in the current context. Unlike Wait() , that exception will be of its original type, not AggregateException . It will also preserve its original stack trace. This exception-throwing behavior is the same as if you had used await . Note that it is still possible to deadlock with this method. See https://blog.stephencleary.com/2014/12/a-tour-of-task-part-6-results.html . | Improve this Doc View Source Synchronize<T>(Task<T>) Blocks the current thread until the task completes. Declaration public static T Synchronize<T>(this Task<T> task) Parameters Type Name Description Task <T> task Returns Type Description T Type Parameters Name Description T Remarks If task is terminated by an exception, that exception will be rethrown in the current context. Unlike Result , that exception will be of its original type, not AggregateException . It will also preserve its original stack trace. This exception-throwing behavior is the same as if you had used await . Note that it is still possible to deadlock with this method. See https://blog.stephencleary.com/2014/12/a-tour-of-task-part-6-results.html ."
},
"api/Recore.Unit.html": {
"href": "api/Recore.Unit.html",
"title": "Struct Unit | RecoreFX",
"keywords": "Struct Unit A type with only one value. Implements IEquatable < Unit > Inherited Members Object.Equals(Object, Object) Object.GetType() Object.ReferenceEquals(Object, Object) Namespace : Recore Assembly : Recore.dll Syntax public struct Unit : IEquatable<Unit> Remarks Whereas Void is a type with no values, Unit is a type with one value. It is useful when designing generic types or methods so that a non-generic version does not have to be provided. It is also useful for fluent interfaces (such as LINQ) so that a chain of method calls does not have to be broken by a Void -returning call. Examples Imagine a type ApiResult<T> that wraps the deserialized JSON response from a REST API. Without Unit , you'd have to define a separate, non-generic ApiResult type for when the response doesn't have a body: ApiResult postResult = await PostPersonAsync(person); ApiResult<Person> getResult = await GetPersonAsync(id); With Unit , you can just reuse the same type: ApiResult<Unit> postResult = await PostPersonAsync(person); ApiResult<Person> getResult = await GetPersonAsync(id); In the definition of PostPersonAsync() , just return Unit.Value : ApiResult<Unit> PostPersonAsync(Person person) { // ... return new ApiResult<Unit>(Unit.Value); } Properties | Improve this Doc View Source Value The singleton Unit value. Declaration public static Unit Value { get; } Property Value Type Description Unit Methods | Improve this Doc View Source Close(Action) Converts a return type of Void to a return type of Unit . Declaration public static Func<Unit> Close(Action action) Parameters Type Name Description Action action Returns Type Description Func < Unit > | Improve this Doc View Source Equals(Unit) Two unit instances are always equal. Declaration public bool Equals(Unit other) Parameters Type Name Description Unit other Returns Type Description Boolean | Improve this Doc View Source Equals(Object) Determines whether another object is the unit value. Declaration public override bool Equals(object obj) Parameters Type Name Description Object obj Returns Type Description Boolean Overrides ValueType.Equals(Object) | Improve this Doc View Source GetHashCode() Returns the hash code of the unit value. Declaration public override int GetHashCode() Returns Type Description Int32 Overrides ValueType.GetHashCode() | Improve this Doc View Source ToString() Returns a string representation of the unit value. Declaration public override string ToString() Returns Type Description String Overrides ValueType.ToString() Operators | Improve this Doc View Source Equality(Unit, Unit) Two unit instances are always equal. Declaration public static bool operator ==(Unit lhs, Unit rhs) Parameters Type Name Description Unit lhs Unit rhs Returns Type Description Boolean | Improve this Doc View Source Inequality(Unit, Unit) Two unit instances are always equal. Declaration public static bool operator !=(Unit lhs, Unit rhs) Parameters Type Name Description Unit lhs Unit rhs Returns Type Description Boolean Implements System.IEquatable<T> Extension Methods ObjectExtensions.StaticCast<T>(T) ObjectExtensions.Apply<T, TResult>(T, Func<T, TResult>) ObjectExtensions.Apply<T>(T, Action<T>)"
},
"api/Recore.UriExtensions.html": {
"href": "api/Recore.UriExtensions.html",
"title": "Class UriExtensions | RecoreFX",
"keywords": "Class UriExtensions Extension methods for the Uri type. Inheritance Object UriExtensions Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Object.ReferenceEquals(Object, Object) Object.ToString() Namespace : Recore Assembly : Recore.dll Syntax public static class UriExtensions Methods | Improve this Doc View Source AsAbsoluteUri(Uri) Returns an instance of AbsoluteUri with the same value as uri if it is absolute, or null if it is relative. Declaration public static AbsoluteUri AsAbsoluteUri(this Uri uri) Parameters Type Name Description Uri uri Returns Type Description AbsoluteUri Remarks Because an instance of Uri may be neither AbsoluteUri nor RelativeUri , patterns like (AbsoluteUri)uri or uri as AbsoluteUri cannot be used reliably. AsAbsoluteUri(Uri) works as uri as AbsoluteUri would if Uri were an abstract base class. It complements IsAbsoluteUri in this regard. | Improve this Doc View Source AsRelativeUri(Uri) Returns an instance of AbsoluteUri with the same value as uri if it is absolute, or null if it is relative. Declaration public static RelativeUri AsRelativeUri(this Uri uri) Parameters Type Name Description Uri uri Returns Type Description RelativeUri Remarks Because an instance of Uri may be neither AbsoluteUri nor RelativeUri , patterns like (AbsoluteUri)uri or uri as AbsoluteUri cannot be used reliably. AsRelativeUri(Uri) works as uri as RelativeUri would if Uri were an abstract base class."
},
"index.html": {
"href": "index.html",
"title": "RecoreFX | RecoreFX",
"keywords": "RecoreFX RecoreFX fills the most common needs for C# code after the .NET standard library. Installation Install from NuGet : dotnet add package RecoreFX Why use it? Convenience methods If you're like me, there's a bunch of useful methods that you write for every project you work on. Some are simple, such as IDictionary.GetOrAdd() . Others are more subtle, such as SecureCompare.TimeInvariantEquals() . There's a lot of low-hanging fruit. Want JavaScript-style IIFEs? Write Func.Invoke() . Want ad-hoc RAII like in Go? Create a Defer type. Tired of checking IsAbsoluteUri ? Define an AbsoluteUri subtype. (But let's be honest, who really checks?) All of this starts to add up, though. That's why I put it all together into a single installable, unit-tested package. New stuff There are some other goodies here that are farther reaching: Optional<T> Optional<T> gives you compiler-checked null safety if you don't have nullable references enabled (or if you're on .NET Framework): Optional<string> opt = \"hello\"; Optional<string> empty = Optional<string>.Empty; opt.Switch( x => Console.WriteLine(\"Message: \" + x), () => Console.WriteLine(\"No message\")); Optional<int> messageLength = opt.OnValue(x => x.Length); string message = opt.ValueOr(default); Either<TLeft, TRight> Either<TLeft, TRight> gives you a type-safe union type that will be familiar to TypeScript users: Either<string, int> either = \"hello\"; var message = either.Switch( l => $\"Value is a string: {l}\", r => $\"Value is an int: {r}\"); Result<TValue, TError> Result<TValue, TError> gives you a way to handle \"expected\" errors. You can think of it as a nicer version of the TryParse pattern: async Task<Result<Person, HttpStatusCode>> GetPersonAsync(int id) { var response = await httpClient.GetAsync($\"/api/v1/person/{id}\"); if (response.IsSuccessStatusCode) { var json = await response.Content.ReadAsStringAsync(); var person = JsonSerializer.Deserialize<Person>(json); return Result.Success<Person, HttpStatusCode>(person); } else { return Result.Failure<Person, HttpStatusCode>(response.StatusCode); } } It also makes it easy to build up an error context as you go along rather than terminating immediately: Result<IBlob, IBlob>[] results = await Task.WhenAll(blobsToWrite.Select(blob => Result.TryAsync(async () => { await WriteBlobAsync(blob); return blob; }) .CatchAsync((Exception e) => { Console.Error.WriteLine(e); return Task.FromResult(blob); }))); List<IBlob> successes = results.Successes().ToList(); List<IBlob> failures = results.Failures().ToList(); Of<T> Of<T> makes it easy to define \"type aliases.\" Consider a method with the signature: void AddRecord(string address, string firstName, string lastName) It's easy to make mistakes like this: AddRecord(\"Jane\", \"Doe\", \"1 Microsoft Way\"); // oops! You can prevent this with strong typing: class Address : Of<string> {} void AddRecord(Address address, string firstName, string lastName) {} AddRecord(\"Jane\", \"Doe\", \"1 Microsoft Way\"); // compiler error While defining a new type that behaves the same way string does usually takes a lot of boilerplate, Of<T> handles this automatically: var address = new Address { Value = \"1 Microsoft Way\" }; Console.WriteLine(address); // prints \"1 Microsoft Way\" var address2 = new Address { Value = \"1 Microsoft Way\" }; Console.WriteLine(address == address2); // prints \"true\" Pipeline<T> Pipeline<T> gives you a way to call any method with postfix syntax: var result = Pipeline.Of(value) .Then(Foo) .Then(Bar) .Then(Baz) .Result; Defer Defer is analogous to Golang's defer statement. It lets you do some kind of cleanup before exiting a method. The classic way to do this in C# is with try-finally : try { Console.WriteLine(\"Doing stuff\"); } finally { Console.WriteLine(\"Running cleanup\"); } With Defer and C# 8's new using declarations, we can do it more simply: using var cleanup = new Defer(() => Console.WriteLine(\"Running cleanup\")); Console.WriteLine(\"Doing stuff\"); Unit Unit is a type with only one value (like how Void is a type with no values). Imagine a type ApiResult<T> that wraps the deserialized JSON response from a REST API. Without Unit , you'd have to define a separate, non-generic ApiResult type for when the response doesn't have a body: ApiResult postResult = await PostPersonAsync(person); ApiResult<Person> getResult = await GetPersonAsync(id); With Unit , you can just reuse the same type: ApiResult<Unit> postResult = await PostPersonAsync(person); ApiResult<Person> getResult = await GetPersonAsync(id); In the definition of PostPersonAsync() , just return Unit.Value : ApiResult<Unit> PostPersonAsync(Person person) { // ... return new ApiResult<Unit>(Unit.Value); } These are all borrowed from functional programming, but the goal here isn't to turn C# into F#. RecoreFX is meant to encourage more expressive, type-safe code that's still idiomatic C#. What's in it? Recore AbsoluteUri and RelativeUri AsyncAction , AsyncAction<T> , etc. AsyncFunc<TResult> , AsyncFunc<T, TResult> , etc. Composer<TValue, TResult> and Pipeline<T> Defer Either<TLeft, TRight> , Optional<T> , and Result<TValue, TError> Func Of<T> Unit Recore.Collections.Generic AnonymousEqualityComparer<T> MappedComparer<T, TMapped> MappedEqualityComparer<T, TMapped> Extension methods: ICollection<T>.Append() IDictionary<TKey, TValue>.AddRange() IDictionary<TKey, TValue>.GetOrAdd() IDictionary<TKey, TValue>.GetValueOrDefault() LinkedList<T>.Add() Recore.Linq IEnumerable<T>.Argmax() IEnumerable<T>.Argmin() IEnumerable<T>.Enumerate() IEnumerable<T>.Flatten() IEnumerable<T>.ForEach() IEnumerable<T>.NonNull() IEnumerable<T>.Product() IEnumerable<T>.ToLinkedList() IEnumerable<T>.Zip() IEnumerable<KeyValuePair<TKey, TValue>>.OnKeys() IEnumerable<KeyValuePair<TKey, TValue>>.OnValues() IEnumerable<KeyValuePair<TKey, TValue>>.ToDictionary() Recore.Security.Cryptography Ciphertext<THash> SecureCompare Recore.Threading.Tasks Task.Synchronize() Task<T>.Synchronize() Contributing Have a look at the contributor's guide . FAQs Why doesn't this have $TYPE or $METHOD ? If it's generally useful (as opposed to oriented towards a specific application) and fills a common need in C# programming, then there's no reason why not! Feel free to open an issue or submit a PR for discussion. How does this compare to $LIBRARY ? The design principles of RecoreFX are: Generally useful Common sense-ness Follows the programming paradigm of standard C# If you like RecoreFX, check out these other libraries: louthy/language-ext mcintyre321/OneOf morelinq/MoreLINQ StephenCleary/AsyncEx Does this work with .NET Framework? RecoreFX v1 targets .NET Standard 2.0, so it works with .NET Framework ≥ 4.6.1 . Sample App The RecoreFX Sample App is a fully worked out Web app with a console app client using RecoreFX. Reference https://recorefx.github.io"
}
}