Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

39 lines
1.3 KiB

// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschränkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.Extensions.DependencyInjection;
using NodaTime;
using Squidex.Infrastructure;
using Squidex.Infrastructure.UsageTracking;
#pragma warning disable RECS0092 // Convert field to readonly
namespace Squidex.Config.Domain
{
public static class InfrastructureServices
{
public static void AddMyInfrastructureServices(this IServiceCollection services)
{
services.AddSingletonAs(SystemClock.Instance)
.As<IClock>();
services.AddSingletonAs<BackgroundUsageTracker>()
.As<IUsageTracker>();
services.AddSingletonAs<HttpContextAccessor>()
.As<IHttpContextAccessor>();
services.AddSingletonAs<ActionContextAccessor>()
.As<IActionContextAccessor>();
services.AddTransient(typeof(Lazy<>), typeof(Lazier<>));
}
}
}