# IObjectImportProvider

Namespace: Lithnet.Ecma2Framework

Defines the methods and properties that an object import provider must implement

```csharp
public interface IObjectImportProvider
```

## Methods

### **InitializeAsync(ImportContext)**

Initializes the object import provider. This method is called once at the start of an import operation

```csharp
Task InitializeAsync(ImportContext context)
```

#### Parameters

`context` [ImportContext](https://docs.lithnet.io/ecma2-framework/advanced/index/lithnet.ecma2framework.importcontext)\
The context of the operation

#### Returns

[Task](https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task)\
A task that represents the asynchronous operation

### **CanImportAsync(SchemaType)**

Indicates whether the object import provider can import objects of the specified type

```csharp
Task<bool> CanImportAsync(SchemaType type)
```

#### Parameters

`type` SchemaType\
The type of object to be imported

#### Returns

[Task\<Boolean>](https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1)\
if the provider can import the object, otherwise

### **GetCSEntryChangesAsync(SchemaType, ICSEntryChangeCollection, String, CancellationToken)**

Initiates the operation to import objects of the specified type. Created CSEntryChanges should be added to the provided ICSEntryChangeCollection object.

```csharp
Task GetCSEntryChangesAsync(SchemaType type, ICSEntryChangeCollection csentryCollection, string incomingWatermark, CancellationToken cancellationToken)
```

#### Parameters

`type` SchemaType\
The type of object to import

`csentryCollection` [ICSEntryChangeCollection](https://docs.lithnet.io/ecma2-framework/advanced/index/lithnet.ecma2framework.icsentrychangecollection)\
The collection of CSEntryChange objects to add the imported objects to

`incomingWatermark` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)\
The watermark value provided by the management agent after its last successful import

`cancellationToken` [CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken)\
A cancellation token

#### Returns

[Task](https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task)\
A task that represents the asynchronous operation

### **GetOutboundWatermark(SchemaType, CancellationToken)**

Gets the outbound watermark to save to the synchronization service at the completion of the import operation If the management agent doesn't support delta operations, then this method should return null

```csharp
Task<string> GetOutboundWatermark(SchemaType type, CancellationToken cancellationToken)
```

#### Parameters

`type` SchemaType\
The object type to get the watermark for

`cancellationToken` [CancellationToken](https://docs.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken)\
A cancellation token

#### Returns

[Task\<String>](https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1)\
The outbound watermark, or null if the management agent doesn't support delta operations


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lithnet.io/ecma2-framework/advanced/index/lithnet.ecma2framework.iobjectimportprovider.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
