Show / Hide Table of Contents

Class MetadataDefinition

Represents a piece of metadata to extract by querying a source.

Inheritance
object
MetadataDefinition
Implements
IEquatable<MetadataDefinition>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: CrashCABN.Metadata
Assembly: CrashCABN.Metadata.Abstractions.dll
Syntax
public sealed record MetadataDefinition : IEquatable<MetadataDefinition>

Constructors

View Source

MetadataDefinition(object?, QueryType, string, string?, AppliesToEnum, string?)

Represents a piece of metadata to extract by querying a source.

Declaration
public MetadataDefinition(object? Query, QueryType QueryType, string Name = "", string? Source = null, AppliesToEnum AppliesTo = AppliesToEnum.Both, string? Comment = null)
Parameters
Type Name Description
object Query

The query to execute.

QueryType QueryType

The query type to use to map the metadata.

string Name

The name to use to retrieve the metadata value.

string Source

The metadata source, such as a file name.

AppliesToEnum AppliesTo
string Comment

Properties

View Source

AppliesTo

Declaration
[JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Ignore)]
[JsonConverter(typeof(StringEnumConverter))]
public AppliesToEnum AppliesTo { get; init; }
Property Value
Type Description
AppliesToEnum
View Source

Comment

Declaration
[JsonProperty(Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
public string? Comment { get; init; }
Property Value
Type Description
string
View Source

Name

The name to use to retrieve the metadata value.

Declaration
public string Name { get; init; }
Property Value
Type Description
string
View Source

Query

The query to execute.

Declaration
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public object? Query { get; init; }
Property Value
Type Description
object
View Source

QueryType

The query type to use to map the metadata.

Declaration
[JsonProperty(Required = Required.Always)]
[JsonConverter(typeof(StringEnumConverter))]
public QueryType QueryType { get; init; }
Property Value
Type Description
QueryType
View Source

Source

The metadata source, such as a file name.

Declaration
[JsonProperty(Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
public string? Source { get; init; }
Property Value
Type Description
string

Methods

View Source

Equals(MetadataDefinition?)

Indicates whether the current object is equal to another object of the same type.

Declaration
public bool Equals(MetadataDefinition? other)
Parameters
Type Name Description
MetadataDefinition other

An object to compare with this object.

Returns
Type Description
bool

true if the current object is equal to the other parameter; otherwise, false.

View Source

GetHashCode()

Serves as the default hash function.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code for the current object.

Overrides
object.GetHashCode()
View Source

ToString()

Returns a string that represents the current object.

Declaration
public override string ToString()
Returns
Type Description
string

A string that represents the current object.

Overrides
object.ToString()

Implements

IEquatable<T>
  • View Source
In this article
Back to top Generated by DocFX