replaced autofac with TinyIoC

This commit is contained in:
Keivan Beigi
2013-04-02 19:20:05 -07:00
parent bcc20fc8a1
commit aacc53d882
36 changed files with 4286 additions and 406 deletions

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace NzbDrone.Common
{
public static class ReflectionExtensions
{
public static IEnumerable<Type> GetInterfaces(this Assembly assembly)
{
return assembly.GetTypes().Where(c => c.IsInterface);
}
public static IEnumerable<Type> GetImplementations(this Assembly assembly, Type contractType)
{
return assembly.GetTypes()
.Where(implementation =>
contractType.IsAssignableFrom(implementation) &&
!implementation.IsInterface &&
!implementation.IsAbstract
);
}
}
}