---
title: "Class TypedEntityDefinitionConstraintAttribute"
slug: "sdk--stylelabs.m.sdk.models.typed.attributes.typedentitydefinitionconstraintattribute"
abstract: ""
---
# Class TypedEntityDefinitionConstraintAttribute

Allows to put a constraint on [ITypedEntity](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.itypedentity.html) to ensure the handled entity is of a certain entity definition.

## Inheritance

object

TypedEntityDefinitionConstraintAttribute

## Namespace: StylelabsStylelabs.MSdkStylelabs.M.Sdk.ModelsTypedAttributes

## Assembly: Stylelabs.M.Sdk.dll

## Syntax

```csharp
public class TypedEntityDefinitionConstraintAttribute : Attribute
```

## Constructors

### TypedEntityDefinitionConstraintAttribute(string)

Initializes a new instance of the [TypedEntityDefinitionConstraintAttribute](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.typed.attributes.typedentitydefinitionconstraintattribute.html) class.

#### Declaration

```csharp
public TypedEntityDefinitionConstraintAttribute(string definitionName)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | definitionName | The definition name. |

## Properties

### DefinitionName

Gets the entity definition name.

#### Declaration

```csharp
public string DefinitionName { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| string |  |
