2016-11-20 13:34:50 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Tapeti
|
|
|
|
|
{
|
|
|
|
|
public interface IDependencyResolver
|
|
|
|
|
{
|
|
|
|
|
T Resolve<T>() where T : class;
|
2016-12-11 14:08:58 +00:00
|
|
|
|
object Resolve(Type type);
|
2016-11-20 13:34:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2017-01-31 11:01:08 +00:00
|
|
|
|
public interface IDependencyContainer : IDependencyResolver
|
2016-11-20 13:34:50 +00:00
|
|
|
|
{
|
2016-12-11 14:08:58 +00:00
|
|
|
|
void RegisterDefault<TService, TImplementation>() where TService : class where TImplementation : class, TService;
|
2017-02-05 22:22:34 +00:00
|
|
|
|
void RegisterDefault<TService>(Func<TService> factory) where TService : class;
|
|
|
|
|
|
|
|
|
|
void RegisterDefaultSingleton<TService, TImplementation>() where TService : class where TImplementation : class, TService;
|
|
|
|
|
void RegisterDefaultSingleton<TService>(TService instance) where TService : class;
|
|
|
|
|
void RegisterDefaultSingleton<TService>(Func<TService> factory) where TService : class;
|
|
|
|
|
|
2016-11-20 13:34:50 +00:00
|
|
|
|
void RegisterController(Type type);
|
|
|
|
|
}
|
|
|
|
|
}
|