in src/CosmosCache.cs [427:450]
private void Initialize(IOptions<CosmosCacheOptions> optionsAccessor)
{
if (optionsAccessor == null)
{
throw new ArgumentNullException(nameof(optionsAccessor));
}
if (string.IsNullOrEmpty(optionsAccessor.Value.DatabaseName))
{
throw new ArgumentNullException(nameof(optionsAccessor.Value.DatabaseName));
}
if (string.IsNullOrEmpty(optionsAccessor.Value.ContainerName))
{
throw new ArgumentNullException(nameof(optionsAccessor.Value.ContainerName));
}
if (optionsAccessor.Value.ClientBuilder == null && optionsAccessor.Value.CosmosClient == null)
{
throw new ArgumentNullException("You need to specify either a CosmosConfiguration or an existing CosmosClient in the CosmosCacheOptions.");
}
this.options = optionsAccessor.Value;
}