---
title: "Class InMemoryProtectionProvider | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Storage.Repositories.Protectors/InMemoryProtectionProvider/"
---

# Class InMemoryProtectionProvider

> **Inheritance:** `System.Object` -> InMemoryProtectionProvider

###### **Namespace**: [Aurigma.DesignAtoms.Storage.Repositories.Protectors](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Storage.Repositories.Protectors.md)

###### **Assembly**: Aurigma.DesignAtoms.dll

```csharp title="Syntax"
public class InMemoryProtectionProvider : IRepositoryFileProtectionProvider
```

## Implements

* [Aurigma.DesignAtoms.Storage.Repositories.Interfaces.Protectors.IRepositoryFileProtectionProvider](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Storage.Repositories.Interfaces.Protectors/IRepositoryFileProtectionProvider.md)

## Inherited Members

* `System.Object.ToString`
* `System.Object.Equals(System.Object)`
* `System.Object.Equals(System.Object,System.Object)`
* `System.Object.ReferenceEquals(System.Object,System.Object)`
* `System.Object.GetHashCode`
* `System.Object.GetType`
* `System.Object.MemberwiseClone`

## Constructors

### InMemoryProtectionProvider

```csharp
public InMemoryProtectionProvider()
```

## Methods

### IsProtected

```csharp
public bool IsProtected(string fileId)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *fileId* |  |

##### Returns

`System.Boolean`

### IsProtectedAsync

```csharp
public Task<bool> IsProtectedAsync(string fileId)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *fileId* |  |

##### Returns

`System.Threading.Tasks.Task<System.Boolean>`

### TrySetProtection

```csharp
public bool TrySetProtection(string fileId, bool isProtected)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *fileId* |  |
| `System.Boolean` | *isProtected* |  |

##### Returns

`System.Boolean`

### TrySetProtectionAsync

```csharp
public Task<bool> TrySetProtectionAsync(string fileId, bool isProtected)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *fileId* |  |
| `System.Boolean` | *isProtected* |  |

##### Returns

`System.Threading.Tasks.Task<System.Boolean>`

### GetReferenceCount

```csharp
public int GetReferenceCount(string fileId)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *fileId* |  |

##### Returns

`System.Int32`

### ClearProtection

```csharp
public void ClearProtection(string fileId)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *fileId* |  |

### ClearAll

```csharp
public void ClearAll()
```

### GetProtectedFiles

```csharp
public IEnumerable<string> GetProtectedFiles()
```

##### Returns

`System.Collections.Generic.IEnumerable<System.String>`
