> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SuperOffice.WebApi.Agents.IRelationAgent

<h1 id="SuperOffice_WebApi_Agents_IRelationAgent">
  Interface IRelationAgent
</h1>

Namespace: [SuperOffice.WebApi.Agents](SuperOffice.WebApi.Agents.md)\
Assembly: SuperOffice.WebApi.dll

Contact/Person relations

```csharp theme={null}
public interface IRelationAgent : IAgentBase, IDisposable
```

#### Implements

[IAgentBase](SuperOffice.WebApi.Agents.IAgentBase.md),
[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

## Methods

<h3 id="SuperOffice_WebApi_Agents_IRelationAgent_CreateDefaultContactRelationEntityAsync_SuperOffice_WebApi_RequestOptions_">
  CreateDefaultContactRelationEntityAsync(RequestOptions)
</h3>

Set default values into a new ContactRelationEntity.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<ContactRelationEntity> CreateDefaultContactRelationEntityAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ContactRelationEntity](SuperOffice.WebApi.Data.ContactRelationEntity.md)\&gt;

A blank ContactRelationEntity

<h3 id="SuperOffice_WebApi_Agents_IRelationAgent_DeleteContactRelationAsync_System_Int32_SuperOffice_WebApi_RequestOptions_">
  DeleteContactRelationAsync(int, RequestOptions)
</h3>

Deletes the spesified contact relation.

```csharp theme={null}
Task DeleteContactRelationAsync(int contactRelationEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`contactRelationEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Relation to delete

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

<h3 id="SuperOffice_WebApi_Agents_IRelationAgent_GetContactRelationEntityAsync_System_Int32_SuperOffice_WebApi_RequestOptions_">
  GetContactRelationEntityAsync(int, RequestOptions)
</h3>

Gets a specific ContactRelationEntity object.

```csharp theme={null}
Task<ContactRelationEntity> GetContactRelationEntityAsync(int contactRelationEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`contactRelationEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the ContactRelationEntity object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ContactRelationEntity](SuperOffice.WebApi.Data.ContactRelationEntity.md)\&gt;

ContactRelationEntity

<h3 id="SuperOffice_WebApi_Agents_IRelationAgent_SaveContactRelationAsync_SuperOffice_WebApi_Data_ContactRelationEntity_SuperOffice_WebApi_RequestOptions_">
  SaveContactRelationAsync(ContactRelationEntity, RequestOptions)
</h3>

Creates a new or updates an existing contact relation.

```csharp theme={null}
Task<ContactRelationEntity> SaveContactRelationAsync(ContactRelationEntity contactRelationEntity, RequestOptions requestOptions = null)
```

#### Parameters

`contactRelationEntity` [ContactRelationEntity](SuperOffice.WebApi.Data.ContactRelationEntity.md)

Relation to save

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ContactRelationEntity](SuperOffice.WebApi.Data.ContactRelationEntity.md)\&gt;

Saved relation


## Related topics

- [SuperOffice.WebApi.Agents.RelationAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.RelationAgent.md)
- [SuperOffice.WebApi.Agents.IListAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IListAgent.md)
- [SuperOffice.WebApi.Agents.ListAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.ListAgent.md)
- [SuperOffice.WebApi.Agents.ITicketAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.ITicketAgent.md)
- [SuperOffice.WebApi.Agents.TicketAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.TicketAgent.md)
- [SuperOffice.WebApi.Agents.IUserAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IUserAgent.md)
