|
5 | 5 | | ---- | ----------- | |
6 | 6 | | [GetOrThrow(String)](MrKWatkins.Ast.Properties.GetOrThrow.md#mrkwatkins-ast-properties-getorthrow-1(system-string)) | Gets the value of a single valued property with the specified key or throws an exception if the property does not exist. | |
7 | 7 | | [GetOrThrow(String, T)](MrKWatkins.Ast.Properties.GetOrThrow.md#mrkwatkins-ast-properties-getorthrow-1(system-string-0@)) | Gets the value of a single valued property with the specified key or throws an exception if the property does not exist. Uses a field to cache the value for better performance. | |
| 8 | +| [GetOrThrow(String, T?)](MrKWatkins.Ast.Properties.GetOrThrow.md#mrkwatkins-ast-properties-getorthrow-1(system-string-system-nullable((-0))@)) | Gets the value of a single valued property with the specified key or throws an exception if the property does not exist. Uses a field to cache the value for better performance. | |
8 | 9 | | [GetOrThrow(String, Func<Exception>)](MrKWatkins.Ast.Properties.GetOrThrow.md#mrkwatkins-ast-properties-getorthrow-1(system-string-system-func((system-exception)))) | Gets the value of a single valued property with the specified key or throws an exception if the property does not exist. | |
9 | 10 | | [GetOrThrow(String, T, Func<Exception>)](MrKWatkins.Ast.Properties.GetOrThrow.md#mrkwatkins-ast-properties-getorthrow-1(system-string-0@-system-func((system-exception)))) | Gets the value of a single valued property with the specified key or throws an exception if the property does not exist. Uses a field to cache the value for better performance. | |
| 11 | +| [GetOrThrow(String, T?, Func<Exception>)](MrKWatkins.Ast.Properties.GetOrThrow.md#mrkwatkins-ast-properties-getorthrow-1(system-string-system-nullable((-0))@-system-func((system-exception)))) | Gets the value of a single valued property with the specified key or throws an exception if the property does not exist. Uses a field to cache the value for better performance. | |
10 | 12 | | [GetOrThrow(String, Func<String, Exception>)](MrKWatkins.Ast.Properties.GetOrThrow.md#mrkwatkins-ast-properties-getorthrow-1(system-string-system-func((system-string-system-exception)))) | Gets the value of a single valued property with the specified key or throws an exception if the property does not exist. | |
11 | 13 | | [GetOrThrow(String, T, Func<String, Exception>)](MrKWatkins.Ast.Properties.GetOrThrow.md#mrkwatkins-ast-properties-getorthrow-1(system-string-0@-system-func((system-string-system-exception)))) | Gets the value of a single valued property with the specified key or throws an exception if the property does not exist. Uses a field to cache the value for better performance. | |
| 14 | +| [GetOrThrow(String, T?, Func<String, Exception>)](MrKWatkins.Ast.Properties.GetOrThrow.md#mrkwatkins-ast-properties-getorthrow-1(system-string-system-nullable((-0))@-system-func((system-string-system-exception)))) | Gets the value of a single valued property with the specified key or throws an exception if the property does not exist. Uses a field to cache the value for better performance. | |
12 | 15 |
|
13 | 16 | ## GetOrThrow<T>(string) {id="mrkwatkins-ast-properties-getorthrow-1(system-string)"} |
14 | 17 |
|
|
65 | 68 | The value of the property. |
66 | 69 | ## Remarks {id="remarks-mrkwatkins-ast-properties-getorthrow-1(system-string-0@)"} |
67 | 70 |
|
| 71 | +Properties are stored in a dictionary which might not have enough performance in some situations. Use this overload to get higher performance as the value will be taken from the field if it exists. Make sure to use [Set(String, T, T)](MrKWatkins.Ast.Properties.Set.md#mrkwatkins-ast-properties-set-1(system-string-0-0@)) to update the cached field. |
| 72 | +## GetOrThrow<T>(string, T?) {id="mrkwatkins-ast-properties-getorthrow-1(system-string-system-nullable((-0))@)"} |
| 73 | + |
| 74 | +Gets the value of a single valued property with the specified key or throws an exception if the property does not exist. Uses a field to cache the value for better performance. |
| 75 | + |
| 76 | +```c# |
| 77 | +public T GetOrThrow<T>(string key, ref T? cached) |
| 78 | + where T : ValueType, new(); |
| 79 | +``` |
| 80 | + |
| 81 | +### Type Parameters {id="type-parameters-mrkwatkins-ast-properties-getorthrow-1(system-string-system-nullable((-0))@)"} |
| 82 | + |
| 83 | +| Name | Description | |
| 84 | +| ---- | ----------- | |
| 85 | +| T | The type of the property. | |
| 86 | + |
| 87 | +## Parameters {id="parameters-mrkwatkins-ast-properties-getorthrow-1(system-string-system-nullable((-0))@)"} |
| 88 | + |
| 89 | +| Name | Type | Description | |
| 90 | +| ---- | ---- | ----------- | |
| 91 | +| key | [String](https://learn.microsoft.com/en-gb/dotnet/api/System.String) | The key of the property. | |
| 92 | +| cached | [T?](https://learn.microsoft.com/en-gb/dotnet/api/System.Nullable-1) | The key of the property. | |
| 93 | + |
| 94 | +## Returns {id="returns-mrkwatkins-ast-properties-getorthrow-1(system-string-system-nullable((-0))@)"} |
| 95 | + |
| 96 | +T |
| 97 | + |
| 98 | +The value of the property. |
| 99 | +## Remarks {id="remarks-mrkwatkins-ast-properties-getorthrow-1(system-string-system-nullable((-0))@)"} |
| 100 | + |
68 | 101 | Properties are stored in a dictionary which might not have enough performance in some situations. Use this overload to get higher performance as the value will be taken from the field if it exists. Make sure to use [Set(String, T, T)](MrKWatkins.Ast.Properties.Set.md#mrkwatkins-ast-properties-set-1(system-string-0-0@)) to update the cached field. |
69 | 102 | ## GetOrThrow<T>(string, Func<Exception>) {id="mrkwatkins-ast-properties-getorthrow-1(system-string-system-func((system-exception)))"} |
70 | 103 |
|
|
123 | 156 | The value of the property. |
124 | 157 | ## Remarks {id="remarks-mrkwatkins-ast-properties-getorthrow-1(system-string-0@-system-func((system-exception)))"} |
125 | 158 |
|
| 159 | +Properties are stored in a dictionary which might not have enough performance in some situations. Use this overload to get higher performance as the value will be taken from the field if it exists. Make sure to use [Set(String, T, T)](MrKWatkins.Ast.Properties.Set.md#mrkwatkins-ast-properties-set-1(system-string-0-0@)) to update the cached field. |
| 160 | +## GetOrThrow<T>(string, T?, Func<Exception>) {id="mrkwatkins-ast-properties-getorthrow-1(system-string-system-nullable((-0))@-system-func((system-exception)))"} |
| 161 | + |
| 162 | +Gets the value of a single valued property with the specified key or throws an exception if the property does not exist. Uses a field to cache the value for better performance. |
| 163 | + |
| 164 | +```c# |
| 165 | +public T GetOrThrow<T>(string key, ref T? cached, Func<Exception> exceptionCreator) |
| 166 | + where T : ValueType, new(); |
| 167 | +``` |
| 168 | + |
| 169 | +### Type Parameters {id="type-parameters-mrkwatkins-ast-properties-getorthrow-1(system-string-system-nullable((-0))@-system-func((system-exception)))"} |
| 170 | + |
| 171 | +| Name | Description | |
| 172 | +| ---- | ----------- | |
| 173 | +| T | The type of the property. | |
| 174 | + |
| 175 | +## Parameters {id="parameters-mrkwatkins-ast-properties-getorthrow-1(system-string-system-nullable((-0))@-system-func((system-exception)))"} |
| 176 | + |
| 177 | +| Name | Type | Description | |
| 178 | +| ---- | ---- | ----------- | |
| 179 | +| key | [String](https://learn.microsoft.com/en-gb/dotnet/api/System.String) | The key of the property. | |
| 180 | +| cached | [T?](https://learn.microsoft.com/en-gb/dotnet/api/System.Nullable-1) | The key of the property. | |
| 181 | +| exceptionCreator | [Func<Exception>](https://learn.microsoft.com/en-gb/dotnet/api/System.Func-1) | Function to create an exception to throw if the no property with the specified `key` exists. | |
| 182 | + |
| 183 | +## Returns {id="returns-mrkwatkins-ast-properties-getorthrow-1(system-string-system-nullable((-0))@-system-func((system-exception)))"} |
| 184 | + |
| 185 | +T |
| 186 | + |
| 187 | +The value of the property. |
| 188 | +## Remarks {id="remarks-mrkwatkins-ast-properties-getorthrow-1(system-string-system-nullable((-0))@-system-func((system-exception)))"} |
| 189 | + |
126 | 190 | Properties are stored in a dictionary which might not have enough performance in some situations. Use this overload to get higher performance as the value will be taken from the field if it exists. Make sure to use [Set(String, T, T)](MrKWatkins.Ast.Properties.Set.md#mrkwatkins-ast-properties-set-1(system-string-0-0@)) to update the cached field. |
127 | 191 | ## GetOrThrow<T>(string, Func<String, Exception>) {id="mrkwatkins-ast-properties-getorthrow-1(system-string-system-func((system-string-system-exception)))"} |
128 | 192 |
|
@@ -182,3 +246,34 @@ The value of the property. |
182 | 246 | ## Remarks {id="remarks-mrkwatkins-ast-properties-getorthrow-1(system-string-0@-system-func((system-string-system-exception)))"} |
183 | 247 |
|
184 | 248 | Properties are stored in a dictionary which might not have enough performance in some situations. Use this overload to get higher performance as the value will be taken from the field if it exists. Make sure to use [Set(String, T, T)](MrKWatkins.Ast.Properties.Set.md#mrkwatkins-ast-properties-set-1(system-string-0-0@)) to update the cached field. |
| 249 | +## GetOrThrow<T>(string, T?, Func<String, Exception>) {id="mrkwatkins-ast-properties-getorthrow-1(system-string-system-nullable((-0))@-system-func((system-string-system-exception)))"} |
| 250 | + |
| 251 | +Gets the value of a single valued property with the specified key or throws an exception if the property does not exist. Uses a field to cache the value for better performance. |
| 252 | + |
| 253 | +```c# |
| 254 | +public T GetOrThrow<T>(string key, ref T? cached, Func<String, Exception> exceptionCreator) |
| 255 | + where T : ValueType, new(); |
| 256 | +``` |
| 257 | + |
| 258 | +### Type Parameters {id="type-parameters-mrkwatkins-ast-properties-getorthrow-1(system-string-system-nullable((-0))@-system-func((system-string-system-exception)))"} |
| 259 | + |
| 260 | +| Name | Description | |
| 261 | +| ---- | ----------- | |
| 262 | +| T | The type of the property. | |
| 263 | + |
| 264 | +## Parameters {id="parameters-mrkwatkins-ast-properties-getorthrow-1(system-string-system-nullable((-0))@-system-func((system-string-system-exception)))"} |
| 265 | + |
| 266 | +| Name | Type | Description | |
| 267 | +| ---- | ---- | ----------- | |
| 268 | +| key | [String](https://learn.microsoft.com/en-gb/dotnet/api/System.String) | The key of the property. | |
| 269 | +| cached | [T?](https://learn.microsoft.com/en-gb/dotnet/api/System.Nullable-1) | The key of the property. | |
| 270 | +| exceptionCreator | [Func<String, Exception>](https://learn.microsoft.com/en-gb/dotnet/api/System.Func-2) | Function to create an exception to throw if the no property with the specified `key` exists. | |
| 271 | + |
| 272 | +## Returns {id="returns-mrkwatkins-ast-properties-getorthrow-1(system-string-system-nullable((-0))@-system-func((system-string-system-exception)))"} |
| 273 | + |
| 274 | +T |
| 275 | + |
| 276 | +The value of the property. |
| 277 | +## Remarks {id="remarks-mrkwatkins-ast-properties-getorthrow-1(system-string-system-nullable((-0))@-system-func((system-string-system-exception)))"} |
| 278 | + |
| 279 | +Properties are stored in a dictionary which might not have enough performance in some situations. Use this overload to get higher performance as the value will be taken from the field if it exists. Make sure to use [Set(String, T, T)](MrKWatkins.Ast.Properties.Set.md#mrkwatkins-ast-properties-set-1(system-string-0-0@)) to update the cached field. |
0 commit comments