Class MetadataFilter
A filter that can be applied to Microsoft updates based on their metadata: title, hardware id, KB article, etc.
Use this filter to filter updates when copying updates between IMetadataSource and IMetadataStore
Inheritance
Implements
Namespace: Microsoft.PackageGraph.MicrosoftUpdate.Metadata
Assembly: package-graph-microsoft-update.dll
Syntax
public class MetadataFilter : IMetadataFilter
Constructors
| Improve this Doc View SourceMetadataFilter()
Initialize a new filter. An empty filter matches all updates or categories.
Declaration
public MetadataFilter()
Fields
| Improve this Doc View SourceCategoryFilter
Get or set the Classification or Product filter.
Declaration
public List<Guid> CategoryFilter
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Guid> | List of classification or product IDs (ID only, no revision) |
ComputerHardwareIdFilter
Returns only driver updates that target this computer hardware ID
Declaration
public Guid ComputerHardwareIdFilter
Field Value
Type | Description |
---|---|
System.Guid | Computer hardware ID (GUID) |
FirstX
Returns the first X results only
Declaration
public int FirstX
Field Value
Type | Description |
---|---|
System.Int32 | 0 to include all updates, greater than 0 value to limit output. |
HardwareIdFilter
Returns only driver updates that match this hardware ID.
Declaration
public string HardwareIdFilter
Field Value
Type | Description |
---|---|
System.String | Hardware id string |
IdFilter
Get or set the ID filter.
Declaration
public List<Guid> IdFilter
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Guid> | List of update IDs (ID only, no revision) |
KbArticleFilter
Get or set the KB article filter
Declaration
public List<string> KbArticleFilter
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<System.String> | List of KB article ids - numbers only |
SkipSuperseded
Get or set whether to filter out superseded updates
Declaration
public bool SkipSuperseded
Field Value
Type | Description |
---|---|
System.Boolean | True to skip superseded updates, false otherwise |
TitleFilter
Get or set the title filter.
Declaration
public string TitleFilter
Field Value
Type | Description |
---|---|
System.String | Title filter string |
Methods
| Improve this Doc View SourceApply(IMetadataStore)
Apply the filter to a IMetadataSource and returns matching packages of type MicrosoftUpdatePackage
Declaration
public IEnumerable<IPackage> Apply(IMetadataStore source)
Parameters
Type | Name | Description |
---|---|---|
IMetadataStore | source | The metadata store to filter |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPackage> | Matching packages |
Apply<T>(IMetadataStore)
Apply the filter to a IMetadataSource and returns the matching packages of the specified type.
Declaration
public IEnumerable<T> Apply<T>(IMetadataStore source)
where T : MicrosoftUpdatePackage
Parameters
Type | Name | Description |
---|---|---|
IMetadataStore | source | The metadata store to filter |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | Matching packages |
Type Parameters
Name | Description |
---|---|
T | Package type to query. The type must inherit MicrosoftUpdatePackage |
FromJson(String)
Create a filter from JSON
Declaration
public static MetadataFilter FromJson(string source)
Parameters
Type | Name | Description |
---|---|---|
System.String | source | The JSON string |
Returns
Type | Description |
---|---|
MetadataFilter | A filter for metadata in a updates metadata source |
ToJson()
Serializes this filter to JSON
Declaration
public string ToJson()
Returns
Type | Description |
---|---|
System.String | The JSON string |