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

# \<a id="SuperOffice\_WebApi\_Agents\_MDOAgent">\</a> Class MDOAgent

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

MDO Lists, reading, searching, and item lookup.

```csharp theme={null}
public class MDOAgent : AgentBase, IMDOAgent, IAgentBase, IDisposable
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ←
[AgentBase](SuperOffice.WebApi.Agents.AgentBase.md) ←
[MDOAgent](SuperOffice.WebApi.Agents.MDOAgent.md)

#### Implements

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

#### Inherited Members

[AgentBase.\_json](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__json),
[AgentBase.\_binary](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__binary),
[AgentBase.\_config](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__config),
[AgentBase.\_client](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__client),
[AgentBase.\_disposeClient](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__disposeClient),
[AgentBase.Merge(RequestOptions)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Merge_SuperOffice_WebApi_RequestOptions_),
[AgentBase.BuildRequestFromObject(HttpMethod, string, object, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_BuildRequestFromObject_System_Net_Http_HttpMethod_System_String_System_Object_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.BuildRequestFromStream(HttpMethod, string, Stream, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_BuildRequestFromStream_System_Net_Http_HttpMethod_System_String_System_IO_Stream_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.BuildRequestFromObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_BuildRequestFromObjectWithStream_System_Net_Http_HttpMethod_System_String_System_Object_System_IO_Stream_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.ParseAuthorization(IAuthorization)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ParseAuthorization_SuperOffice_WebApi_Authorization_IAuthorization_),
[AgentBase.CancelRequest()](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_CancelRequest),
[AgentBase.SendRequestObject(HttpMethod, string, object, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_SendRequestObject_System_Net_Http_HttpMethod_System_String_System_Object_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.SendRequestObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_SendRequestObjectWithStream_System_Net_Http_HttpMethod_System_String_System_Object_System_IO_Stream_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.SendRequest(HttpRequestMessage, RequestOptions)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_SendRequest_System_Net_Http_HttpRequestMessage_SuperOffice_WebApi_RequestOptions_),
[AgentBase.ThrowOnResponseErrorAsync(HttpRequestMessage, HttpResponseMessage)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ThrowOnResponseErrorAsync_System_Net_Http_HttpRequestMessage_System_Net_Http_HttpResponseMessage_),
[AgentBase.ParseResponse\<T\&gt;(HttpResponseMessage)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ParseResponse__1_System_Net_Http_HttpResponseMessage_),
[AgentBase.Finally(RequestOptions)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Finally_SuperOffice_WebApi_RequestOptions_),
[AgentBase.Dispose()](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Dispose),
[AgentBase.Configuration](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Configuration),
[AgentBase.Client](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Client),
[AgentBase.HasRunningRequest](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_HasRunningRequest),
[AgentBase.ClientCancellationTokenSource](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ClientCancellationTokenSource),
[AgentBase.ProgressListener](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ProgressListener),
[AgentBase.UploadProgressListener](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_UploadProgressListener),
[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring),
[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)),
[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)),
[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals),
[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode),
[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype),
[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone)

## Examples

\<pre>\<code class="lang-csharp">using SuperOffice.WebApi;
using SuperOffice.WebApi.Agents;

var mySession = new WebApiOptions("[http://example.com/super/api](http://example.com/super/api)");
mySession.Authorization = new AuthorizationUsernamePassword("user", "pass");
using (MDOAgent agent = new MDOAgent(mySession))
\{
// call methods on agent here...
}\</code>\</pre>

## Constructors

### \<a id="SuperOffice\_WebApi\_Agents\_MDOAgent\_\_ctor\_System\_Net\_Http\_HttpClient\_">\</a> MDOAgent(HttpClient)

Constructor: MDO Lists, reading, searching, and item lookup.

```csharp theme={null}
public MDOAgent(HttpClient httpClient)
```

#### Parameters

`httpClient` [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient)

Use this HTTP client instead of making own HttpClient instance.

### \<a id="SuperOffice\_WebApi\_Agents\_MDOAgent\_\_ctor\_SuperOffice\_WebApi\_WebApiOptions\_System\_Net\_Http\_HttpClient\_">\</a> MDOAgent(WebApiOptions, HttpClient)

Constructor: MDO Lists, reading, searching, and item lookup.

```csharp theme={null}
public MDOAgent(WebApiOptions options, HttpClient httpClient = null)
```

#### Parameters

`options` [WebApiOptions](SuperOffice.WebApi.WebApiOptions.md)

Base URL and authentication values.

`httpClient` [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient)

Optional: Use this HTTP client instead of making a new one.

## Methods

### \<a id="SuperOffice\_WebApi\_Agents\_MDOAgent\_GetListAsync\_System\_String\_System\_Boolean\_System\_String\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetListAsync(string, bool, string, bool, RequestOptions)

Method to get a MDO list.

```csharp theme={null}
public Task<MDOListItem[]> GetListAsync(string name, bool forceFlatList, string additionalInfo, bool onlyHistory, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list-

`forceFlatList` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Force the list to be flat

`additionalInfo` [string](https://learn.microsoft.com/dotnet/api/system.string)

Additional info to the MDO provider

`onlyHistory` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true, return only history items

`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)\<[MDOListItem](SuperOffice.WebApi.Data.MDOListItem.md)\[]\&gt;

Array of MDOListItem

### \<a id="SuperOffice\_WebApi\_Agents\_MDOAgent\_GetListIdByListNameAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetListIdByListNameAsync(string, RequestOptions)

Retrieve the UdListDefinition id of a list, by its name. Not all lists have such an ID, but those that are based on tables do (the list name is then the same as the table name)

```csharp theme={null}
public Task<int> GetListIdByListNameAsync(string name, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

The list name, same as the table name for lists that are backed by tables

`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)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\&gt;

List id in the UdListDefinition table

### \<a id="SuperOffice\_WebApi\_Agents\_MDOAgent\_GetListItemAsync\_System\_String\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetListItemAsync(string, int, RequestOptions)

Returns a single list item

```csharp theme={null}
public Task<MDOListItem> GetListItemAsync(string listName, int id, RequestOptions requestOptions = null)
```

#### Parameters

`listName` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list

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

Id of list item

`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)\<[MDOListItem](SuperOffice.WebApi.Data.MDOListItem.md)\&gt;

Single MDO list item

### \<a id="SuperOffice\_WebApi\_Agents\_MDOAgent\_GetListNamesAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetListNamesAsync(RequestOptions)

Returns a list of all MDO List names. These names can also be used with the Archive agent as ProviderNames.

```csharp theme={null}
public Task<string[]> GetListNamesAsync(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)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\[]\&gt;

Array of list names.

### \<a id="SuperOffice\_WebApi\_Agents\_MDOAgent\_GetListWithHistoryAsync\_System\_String\_System\_Boolean\_System\_String\_System\_Int32\_\_\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetListWithHistoryAsync(string, bool, string, int\[], bool, RequestOptions)

Method to get a MDO list with own history list.

```csharp theme={null}
public Task<MDOListItem[]> GetListWithHistoryAsync(string name, bool forceFlatList, string additionalInfo, int[] historyItems, bool onlyHistory, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list-

`forceFlatList` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Force the list to be flat

`additionalInfo` [string](https://learn.microsoft.com/dotnet/api/system.string)

Additional info to the MDO provider

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

An array of ids, used to get the history list

`onlyHistory` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true, return only history items

`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)\<[MDOListItem](SuperOffice.WebApi.Data.MDOListItem.md)\[]\&gt;

Array of MDOListItem

### \<a id="SuperOffice\_WebApi\_Agents\_MDOAgent\_GetListWithRestrictionAsync\_System\_String\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetListWithRestrictionAsync(string, string, string, RequestOptions)

Method to get a MDO list with restrictions.

```csharp theme={null}
public Task<MDOListItem[]> GetListWithRestrictionAsync(string name, string additionalInfo, string searchValue, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list-

`additionalInfo` [string](https://learn.microsoft.com/dotnet/api/system.string)

Additional info to the MDO provider

`searchValue` [string](https://learn.microsoft.com/dotnet/api/system.string)

the value used to restrict the list

`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)\<[MDOListItem](SuperOffice.WebApi.Data.MDOListItem.md)\[]\&gt;

Array of MDOListItem

### \<a id="SuperOffice\_WebApi\_Agents\_MDOAgent\_GetSelectableListAsync\_System\_String\_System\_Boolean\_System\_String\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetSelectableListAsync(string, bool, string, bool, RequestOptions)

Method to get a Selectable MDO list.

```csharp theme={null}
public Task<SelectableMDOListItem[]> GetSelectableListAsync(string name, bool forceFlatList, string additionalInfo, bool onlyHistory, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list.

`forceFlatList` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Force the list to be flat

`additionalInfo` [string](https://learn.microsoft.com/dotnet/api/system.string)

Additional info to the MDO provider

`onlyHistory` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true, return only history items

`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)\<[SelectableMDOListItem](SuperOffice.WebApi.Data.SelectableMDOListItem.md)\[]\&gt;

Array of SelectableMDOListItem

### \<a id="SuperOffice\_WebApi\_Agents\_MDOAgent\_GetSelectableListWithHistoryAsync\_System\_String\_System\_Boolean\_System\_String\_System\_Int32\_\_\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetSelectableListWithHistoryAsync(string, bool, string, int\[], bool, RequestOptions)

Method to get a Selectable MDO list with own history list.

```csharp theme={null}
public Task<SelectableMDOListItem[]> GetSelectableListWithHistoryAsync(string name, bool forceFlatList, string additionalInfo, int[] historyItems, bool onlyHistory, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list.

`forceFlatList` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Force the list to be flat

`additionalInfo` [string](https://learn.microsoft.com/dotnet/api/system.string)

Additional info to the MDO provider

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

An array of ids, used to get the history list

`onlyHistory` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true, return only history items

`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)\<[SelectableMDOListItem](SuperOffice.WebApi.Data.SelectableMDOListItem.md)\[]\&gt;

Array of SelectableMDOListItem

### \<a id="SuperOffice\_WebApi\_Agents\_MDOAgent\_GetSelectableListWithRestrictionAsync\_System\_String\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetSelectableListWithRestrictionAsync(string, string, string, RequestOptions)

Method to get a Selectable MDO list with restrictions.

```csharp theme={null}
public Task<SelectableMDOListItem[]> GetSelectableListWithRestrictionAsync(string name, string additionalInfo, string searchValue, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list

`additionalInfo` [string](https://learn.microsoft.com/dotnet/api/system.string)

Additional info to the MDO provider

`searchValue` [string](https://learn.microsoft.com/dotnet/api/system.string)

the value used to restrict the list

`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)\<[SelectableMDOListItem](SuperOffice.WebApi.Data.SelectableMDOListItem.md)\[]\&gt;

Array of SelectableMDOListItem

### \<a id="SuperOffice\_WebApi\_Agents\_MDOAgent\_GetSelectableSimpleListAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetSelectableSimpleListAsync(string, RequestOptions)

Method returns a flat Selectable MDO List.

```csharp theme={null}
public Task<SelectableMDOListItem[]> GetSelectableSimpleListAsync(string name, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list

`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)\<[SelectableMDOListItem](SuperOffice.WebApi.Data.SelectableMDOListItem.md)\[]\&gt;

Array of SelectableMDOListItem

### \<a id="SuperOffice\_WebApi\_Agents\_MDOAgent\_GetSimpleListAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetSimpleListAsync(string, RequestOptions)

Method returns a simple flat MDO List.

```csharp theme={null}
public Task<MDOListItem[]> GetSimpleListAsync(string name, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list.

`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)\<[MDOListItem](SuperOffice.WebApi.Data.MDOListItem.md)\[]\&gt;

Array of MDOListItem

### \<a id="SuperOffice\_WebApi\_Agents\_MDOAgent\_SetSelectedAsync\_System\_String\_System\_String\_SuperOffice\_WebApi\_Data\_SelectableMDOListItem\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetSelectedAsync(string, string, SelectableMDOListItem\[], RequestOptions)

Saves the selected values as selected by their given list representation.

```csharp theme={null}
public Task<SelectableMDOListItem[]> SetSelectedAsync(string name, string additionalInfo, SelectableMDOListItem[] selectableMDOList, RequestOptions requestOptions = null)
```

#### Parameters

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

Conceptual name of the MDO list

`additionalInfo` [string](https://learn.microsoft.com/dotnet/api/system.string)

Additional info to the MDO provider

`selectableMDOList` [SelectableMDOListItem](SuperOffice.WebApi.Data.SelectableMDOListItem.md)\[]

Items to be updated

`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)\<[SelectableMDOListItem](SuperOffice.WebApi.Data.SelectableMDOListItem.md)\[]\&gt;

Array of updated SelectableMDOListItems


## Related topics

- [SuperOffice.WebApi.Data.MDOListItem](/en/api/reference/webapi/SuperOffice.WebApi.Data.MDOListItem.md)
- [SuperOffice.WebApi.Data.SelectableMDOListItem](/en/api/reference/webapi/SuperOffice.WebApi.Data.SelectableMDOListItem.md)
- [SuperOffice.WebApi.Agents.AgentBase](/en/api/reference/webapi/SuperOffice.WebApi.Agents.AgentBase.md)
- [SuperOffice.WebApi.Agents.EMailAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.EMailAgent.md)
- [SuperOffice.WebApi.Agents.IEMailAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IEMailAgent.md)
- [SuperOffice.WebApi.Agents.IListAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IListAgent.md)
