Class Mapper
Used to query and map custom data files into key-value pairs.
Inheritance
System.Object
Mapper
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: CrashCABN.Metadata
Assembly: CrashCABN.Metadata.dll
Syntax
public sealed class Mapper
Constructors
View SourceMapper(IAttachmentContainer, ILogger<Mapper>)
Initializes a new instance of the Mapper class.
Declaration
public Mapper(IAttachmentContainer attachments, ILogger<Mapper> logger)
Parameters
Type | Name | Description |
---|---|---|
IAttachmentContainer | attachments | The attachments to use to extract metadata. |
ILogger<Mapper> | logger | The |
Methods
View SourceCombineMetadata(Dictionary<String, MetadataItem>, Dictionary<String, MetadataItem>)
Declaration
public Dictionary<string, MetadataItem> CombineMetadata(Dictionary<string, MetadataItem> first, Dictionary<string, MetadataItem> second)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.String, MetadataItem> | first | |
System.Collections.Generic.Dictionary<System.String, MetadataItem> | second |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, MetadataItem> |
Load(MetadataDefinition)
Loads a single metadata definition into a mapped key-value pair.
Declaration
public async Task<KeyValuePair<string, string>?> Load(MetadataDefinition def)
Parameters
Type | Name | Description |
---|---|---|
MetadataDefinition | def | The metadata definition. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Nullable<System.Collections.Generic.KeyValuePair<System.String, System.String>>> | The key-value pair, if one could be mapped. |
Load(IReadOnlyCollection<MetadataDefinition>)
Loads the metadata definitions into an enumeration of mapped key-value pairs.
Declaration
public async IAsyncEnumerable<KeyValuePair<string, MetadataItem>> Load(IReadOnlyCollection<MetadataDefinition> defs)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IReadOnlyCollection<MetadataDefinition> | defs | The metadata definitions. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.KeyValuePair<System.String, MetadataItem>> | The key-value pairs that could be mapped. |
LoadMetadata(IReadOnlyCollection<MetadataDefinition>, String)
Loads the metadata definitions into a System.Collections.Generic.Dictionary<TKey, TValue>
Declaration
public async Task<Dictionary<string, MetadataItem>> LoadMetadata(IReadOnlyCollection<MetadataDefinition> definitions, string metadataName)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IReadOnlyCollection<MetadataDefinition> | definitions | The metadata definitions. |
System.String | metadataName | A description of the type of metadata being loaded, used in telemetry. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<System.String, MetadataItem>> | A dictionary of items that could be mapped. |