Show / Hide Table of Contents

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
System.Object
MetadataFilter
Implements
IMetadataFilter
Namespace: Microsoft.PackageGraph.MicrosoftUpdate.Metadata
Assembly: package-graph-microsoft-update.dll
Syntax
public class MetadataFilter : IMetadataFilter

Constructors

| Improve this Doc View Source

MetadataFilter()

Initialize a new filter. An empty filter matches all updates or categories.

Declaration
public MetadataFilter()

Fields

| Improve this Doc View Source

CategoryFilter

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)

| Improve this Doc View Source

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)

| Improve this Doc View Source

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.

| Improve this Doc View Source

HardwareIdFilter

Returns only driver updates that match this hardware ID.

Declaration
public string HardwareIdFilter
Field Value
Type Description
System.String

Hardware id string

| Improve this Doc View Source

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)

| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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 Source

Apply(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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

ToJson()

Serializes this filter to JSON

Declaration
public string ToJson()
Returns
Type Description
System.String

The JSON string

Implements

IMetadataFilter
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX