IncludeParameterHelper
Namespace: MJCZone.MediaMatic.AspNetCore.Utilities
Assembly: MJCZone.MediaMatic.AspNetCore
Summary
Helper class for parsing and handling include query parameters.
static public
Contents
Methods (7)
Methods
| Method | Summary |
|---|---|
| ParseIncludeParameter | Parses the include parameter string into a set of included fields. |
| ShouldInclude | Determines if a specific field should be included based on the include parameter. |
| IsWildcard | Determines if the include parameter contains the wildcard token. |
| GetType | |
| ToString | |
| Equals | |
| GetHashCode |
ParseIncludeParameter
Parses the include parameter string into a set of included fields.
csharp
HashSet<string>? ParseIncludeParameter(string includeParameter)Parameters
- includeParameter (string) - The include parameter value from the query string.
Returns
Type: HashSet<string>?
A set of included field names, or null if the parameter is empty.
ShouldInclude
Determines if a specific field should be included based on the include parameter.
csharp
bool ShouldInclude(String} includes, string fieldName)Parameters
- includes (String}) - The parsed include set.
- fieldName (string) - The name of the field to check.
Returns
Type: bool
True if the field should be included, false otherwise.
IsWildcard
Determines if the include parameter contains the wildcard token.
csharp
bool IsWildcard(String} includes)Parameters
- includes (String}) - The parsed include set.
Returns
Type: bool
True if wildcard is present, false otherwise.
GetType
csharp
GetType()ToString
csharp
ToString()Equals
csharp
Equals()GetHashCode
csharp
GetHashCode()