-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathErrorUnitInjector.cs
35 lines (33 loc) · 1.28 KB
/
ErrorUnitInjector.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using ErrorUnit.Interfaces;
//using ErrorUnit.Injector_SimpleInjector.InterceptionExtensions;
using SimpleInjector;
namespace ErrorUnit.Injector_SimpleInjector
{
/// <summary>
/// The Injector link for SimpleInjector
/// </summary>
public class ErrorUnitInjector : IInjector
{
private static Container container = null;
/// <summary>
/// The json serializer to use
/// </summary>
public static IErrorUnitCentral ErrorUnitCentral;
/// <summary>
/// Links the injector.
/// </summary>
/// <typeparam name="C"></typeparam>
/// <param name="ioc">The ioc.</param>
/// <param name="errorUnitCentral">The ErrorUnitCentral.Instance</param>
/// <returns></returns>
public C LinkInjector<C>(C ioc, IErrorUnitCentral errorUnitCentral)
{
container = ioc as Container;
//container.InterceptWith<ErrorUnit.Models.ErrorUnitInterceptor>(t => t != typeof(ErrorUnit.Models.ErrorUnitInterceptor) );
container.InterceptWithErrorUnit();
ErrorUnitInjector.ErrorUnitCentral = errorUnitCentral;
//ErrorUnitInjector.ErrorUnitCentral.serializerSettings.Converters.Add(new ProxiedTypeSerializer());
return ioc;
}
}
}