Table of Contents

Class DataCoverageDefinition

Inheritance
DataCoverageDefinition
Implements
Inherited Members
Namespace
TabularEditor.TOMWrapper
Assembly
TOMWrapper.dll

A tabular DataCoverageDefinition object. The expression defined on this object gives hint about the data in a partition.

public sealed class DataCoverageDefinition : TabularObject, ICustomTypeDescriptor, INotifyPropertyChanging, ITomErrorMessageObject, IDescriptionObject, IAnnotationObject, IExpressionObject, ITabularTableObject, ITabularNamedObject, ITabularObject, INotifyPropertyChanged, INamedObject
Extension Methods

Remarks

This metadata object is only supported when the compatibility level of the database is at 1603 or above.

Properties

Annotations

The collection of Annotations on the current Data Coverage Definition.

[Browsable(true)]
public AnnotationCollection Annotations { get; }

Property Value

Type Description
AnnotationCollection

DefaultExpressionProperty

Gets the default expression property on the current object.

[Browsable(false)]
public ExpressionProperty? DefaultExpressionProperty { get; }

Property Value

Type Description
ExpressionProperty?

Description

The description of the DataCoverageDefinition, visible to developers at design time and to administrators in management tools, such as SQL Server Management Studio.

public string Description { get; set; }

Property Value

Type Description
string

ErrorMessage

The string that explains the error state associated with the DataCoverageDefinition. It is set by the engine only when the state of the Expression is one of these four values: EvaluationError, SemanticError, DependencyError or SyntaxError.

public string ErrorMessage { get; }

Property Value

Type Description
string

Expression

The DAX expression that is evaluated for the DataCoverageDefinition.

public string Expression { get; set; }

Property Value

Type Description
string

MetadataIndex

[Browsable(false)]
public int MetadataIndex { get; }

Property Value

Type Description
int

Name

[Browsable(false)]
public string Name { get; set; }

Property Value

Type Description
string

Partition

A reference to the Partition object that owns the DataCoverageDefinition.

public Partition Partition { get; }

Property Value

Type Description
Partition

State

Provides information on the state of the Expression. Possible values and their interpretation are as follows. Ready (1) The Expression is queryable and has up-to-date data. CalculationNeeded (4): The Expression is not queryable and needs to be refreshed to become functional. SemanticError (5) The Expression has a semantic error. DependencyError (7) A dependency associated with the Expression is in an error state (SemanticError, EvaluationError, or DependencyError). SyntaxError (9) The Expression has a syntax error.

public ObjectState State { get; }

Property Value

Type Description
ObjectState

Table

[Browsable(false)]
public Table Table { get; }

Property Value

Type Description
Table

Methods

CanDelete()

public bool CanDelete()

Returns

Type Description
bool

CanDelete(out string)

public bool CanDelete(out string message)

Parameters

Type Name Description
string message

Returns

Type Description
bool

ClearAnnotations()

Removes all annotations from this object.

public void ClearAnnotations()

CreateFromMetadata(Partition, DataCoverageDefinition)

public static DataCoverageDefinition CreateFromMetadata(Partition parent, DataCoverageDefinition metadataObject)

Parameters

Type Name Description
Partition parent
DataCoverageDefinition metadataObject

Returns

Type Description
DataCoverageDefinition

CreateNew(Partition)

public static DataCoverageDefinition CreateNew(Partition parent)

Parameters

Type Name Description
Partition parent

Returns

Type Description
DataCoverageDefinition

Delete()

public void Delete()

GetAnnotation(int)

Gets the value of the annotation with the given index, assuming it exists.

public string GetAnnotation(int index)

Parameters

Type Name Description
int index

Returns

Type Description
string

GetAnnotation(string)

Gets the value of the annotation with the given name. Returns null if no such annotation exists.

public string GetAnnotation(string name)

Parameters

Type Name Description
string name

Returns

Type Description
string

GetAnnotations()

Gets a collection of all annotation names on the current Data Coverage Definition.

public IEnumerable<string> GetAnnotations()

Returns

Type Description
IEnumerable<string>

GetAnnotationsCount()

Gets the number of annotations on the current Data Coverage Definition.

public int GetAnnotationsCount()

Returns

Type Description
int

GetExpression(ExpressionProperty)

Gets the specified expression from the current object.

public string GetExpression(ExpressionProperty expressionProperty)

Parameters

Type Name Description
ExpressionProperty expressionProperty

Returns

Type Description
string

Exceptions

InvalidEnumArgumentException

Thrown when the current object does not support the specified ExpressionProperty

GetExpressionProperties()

Gets all supported expression properties on the current object.

public IEnumerable<ExpressionProperty> GetExpressionProperties()

Returns

Type Description
IEnumerable<ExpressionProperty>

GetNewAnnotationName()

Returns a unique name for a new annotation.

public string GetNewAnnotationName()

Returns

Type Description
string

HasAnnotation(string)

Returns true if an annotation with the given name exists. Otherwise false.

public bool HasAnnotation(string name)

Parameters

Type Name Description
string name

Returns

Type Description
bool

OnPropertyChanged(string, object, object)

Fired after a property is changed

protected override void OnPropertyChanged(string propertyName, object oldValue, object newValue)

Parameters

Type Name Description
string propertyName
object oldValue
object newValue

RemoveAnnotation(string)

Remove an annotation by the given name.

public void RemoveAnnotation(string name)

Parameters

Type Name Description
string name

SetAnnotation(int, string)

Sets the value of the annotation with the given index, assuming it exists.

public void SetAnnotation(int index, string value)

Parameters

Type Name Description
int index
string value

SetAnnotation(string, string)

Sets the value of the annotation having the given name. If no such annotation exists, it will be created. If value is set to null, the annotation will be removed.

public void SetAnnotation(string name, string value)

Parameters

Type Name Description
string name
string value

SetExpression(ExpressionProperty, string)

Sets the specified expression on the current object.

public void SetExpression(ExpressionProperty expressionProperty, string expression)

Parameters

Type Name Description
ExpressionProperty expressionProperty
string expression

Exceptions

InvalidEnumArgumentException

Thrown when the current object does not support the specified ExpressionProperty