---
title: "Class TypedEntityWrapper"
slug: "sdk--stylelabs.m.sdk.utilities.typedentitywrapper"
abstract: ""
---
# Class TypedEntityWrapper

Wrapper for property access to simplify usage via IL code.

## Inheritance

object

TypedEntityWrapper

## Namespace: StylelabsStylelabs.MSdkUtilities

## Assembly: Stylelabs.M.Sdk.dll

## Syntax

```csharp
public class TypedEntityWrapper
```

## Constructors

### TypedEntityWrapper(IEntity)

Initializes a new instance of the [TypedEntityWrapper](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.utilities.typedentitywrapper.html) class.

#### Declaration

```csharp
public TypedEntityWrapper(IEntity entity)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [IEntity](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ientity.html) | entity | The entity. |

## Methods

### GetPropertyValue<T>(string, CultureInfo)

Gets the value of the specified property.

#### Declaration

```csharp
public T GetPropertyValue<T>(string propertyName, CultureInfo cultureInfo = null)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | propertyName | The name of the property. |
| CultureInfo | cultureInfo | The culture info. |

#### Returns

| Type | Description |
| --- | --- |
| T | The value. |

#### Type Parameters

| Name | Description |
| --- | --- |
| T | The type. |

### GetRelation<TRelation>(string)

Gets the specified relation.

#### Declaration

```csharp
public TRelation GetRelation<TRelation>(string relationName) where TRelation : class, IRelation
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | relationName | The name of the relation. |

#### Returns

| Type | Description |
| --- | --- |
| TRelation | The relation. |

#### Type Parameters

| Name | Description |
| --- | --- |
| TRelation | The type of the relation. |

### SetPropertyValue(string, object, CultureInfo)

Sets the value of the specified property.

#### Declaration

```csharp
public void SetPropertyValue(string propertyName, object value, CultureInfo cultureInfo = null)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | propertyName | The name of the property. |
| object | value | The value. |
| CultureInfo | cultureInfo | The culture info. |
