Refactor collection builders for IContainer

This commit is contained in:
Stephan
2018-07-20 16:36:46 +02:00
parent 5836cd05cb
commit 97da0829a2
45 changed files with 175 additions and 142 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using Umbraco.Core.Composing;
namespace Umbraco.Core
@@ -45,6 +46,9 @@ namespace Umbraco.Core
// fixme - document all these
public static IEnumerable<Registration> GetRegistered<TService>(this IContainer container)
=> container.GetRegistered(typeof(TService));
public static void Register<TService, TImplementing>(this IContainer container, Lifetime lifetime = Lifetime.Transient)
=> container.Register(typeof(TService), typeof(TImplementing), lifetime);