> ## 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

# \<a id="SuperOffice\_WebApi\_Agents\_IRelationAgent">\</a> Interface IRelationAgent

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

### \<a id="SuperOffice\_WebApi\_Agents\_IRelationAgent\_CreateDefaultContactRelationEntityAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultContactRelationEntityAsync(RequestOptions)

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

### \<a id="SuperOffice\_WebApi\_Agents\_IRelationAgent\_DeleteContactRelationAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteContactRelationAsync(int, RequestOptions)

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)

### \<a id="SuperOffice\_WebApi\_Agents\_IRelationAgent\_GetContactRelationEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetContactRelationEntityAsync(int, RequestOptions)

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

### \<a id="SuperOffice\_WebApi\_Agents\_IRelationAgent\_SaveContactRelationAsync\_SuperOffice\_WebApi\_Data\_ContactRelationEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveContactRelationAsync(ContactRelationEntity, RequestOptions)

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)
