Files
EonaCat.DoxaApi/DoxaApi/ServiceCollectionExtensions.cs
T

21 lines
738 B
C#

using EonaCat.DoxaApi.Generation;
using Microsoft.Extensions.DependencyInjection;
namespace EonaCat.DoxaApi
{
// This file is part of the EonaCat project(s) which is released under the Apache License.
// See the LICENSE file or go to https://EonaCat.com/license for full license details.
public static class DoxaApiServiceCollectionExtensions
{
public static IServiceCollection AddDoxaApi(this IServiceCollection services, Action<DoxaApiOptions>? configure = null)
{
var options = new DoxaApiOptions();
configure?.Invoke(options);
services.AddSingleton(options);
services.AddSingleton<MetricsCollector>();
return services;
}
}
}