#### [Abblix\.Oidc\.Server](https://www.abblix.com/en/docs/api/abblix-oidc-server 'index')
### [Abblix\.Oidc\.Server\.Features\.Licensing](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Licensing 'Abblix\.Oidc\.Server\.Features\.Licensing')

## LicenseManager Class

Manages the application's licenses, ensuring that the current license is appropriately evaluated based
on its validity period\.

```csharp
public class LicenseManager
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → LicenseManager

### Remarks
This class supports the addition of multiple licenses and determines the active license by considering their
validity periods\. It uses a thread\-safe approach to manage concurrent access to the licenses list,
allowing for efficient reads and safe updates\.
### Methods

## LicenseManager\.AddLicense\(License\) Method {#Abblix.Oidc.Server.Features.Licensing.LicenseManager.AddLicense(Abblix.Oidc.Server.Features.Licensing.License)}

Adds a new license to the application, placing it in the correct position based on its validity period\.

```csharp
public void AddLicense(Abblix.Oidc.Server.Features.Licensing.License license);
```
#### Parameters

###### `license` [License](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Licensing.License 'Abblix\.Oidc\.Server\.Features\.Licensing\.License') {#Abblix.Oidc.Server.Features.Licensing.LicenseManager.AddLicense(Abblix.Oidc.Server.Features.Licensing.License).license}

The license to be added\.

### Remarks
The method inserts the license into a sorted list, ensuring that licenses are ordered based on their
validity periods\. This ordering facilitates the determination of the current active license\.

## LicenseManager\.GetLicenses\(\) Method {#Abblix.Oidc.Server.Features.Licensing.LicenseManager.GetLicenses()}

Provides access to the currently managed licenses\.

```csharp
public System.Collections.Generic.IEnumerable<Abblix.Oidc.Server.Features.Licensing.License> GetLicenses();
```

#### Returns
[System\.Collections\.Generic\.IEnumerable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1')[License](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Licensing.License 'Abblix\.Oidc\.Server\.Features\.Licensing\.License')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1')  
A sequence of all licenses managed by the LicenseManager\.

## LicenseManager\.TryGetCurrentLicenseLimit\(DateTimeOffset\) Method {#Abblix.Oidc.Server.Features.Licensing.LicenseManager.TryGetCurrentLicenseLimit(System.DateTimeOffset)}

Attempts to retrieve the current license from the LicenseManager based on the given moment in time\.

```csharp
public Abblix.Oidc.Server.Features.Licensing.License? TryGetCurrentLicenseLimit(System.DateTimeOffset utcNow);
```
#### Parameters

###### `utcNow` [System\.DateTimeOffset](https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset 'System\.DateTimeOffset') {#Abblix.Oidc.Server.Features.Licensing.LicenseManager.TryGetCurrentLicenseLimit(System.DateTimeOffset).utcNow}

The current UTC time to determine the active license\.

#### Returns
[License](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Licensing.License 'Abblix\.Oidc\.Server\.Features\.Licensing\.License')  
The current license if one is active and valid, otherwise null\.
