* Stylecop Rules and Fixes
This commit is contained in:
Qstick
2020-01-03 07:49:24 -05:00
committed by GitHub
parent 63d669178d
commit f77a2feeef
1307 changed files with 8704 additions and 7404 deletions
+10 -6
View File
@@ -1,14 +1,16 @@
using System;
using System.Linq;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Common.Composition;
namespace NzbDrone.Common
{
public interface IServiceFactory
{
T Build<T>() where T : class;
IEnumerable<T> BuildAll<T>() where T : class;
T Build<T>()
where T : class;
IEnumerable<T> BuildAll<T>()
where T : class;
object Build(Type contract);
IEnumerable<Type> GetImplementations(Type contract);
}
@@ -22,12 +24,14 @@ namespace NzbDrone.Common
_container = container;
}
public T Build<T>() where T : class
public T Build<T>()
where T : class
{
return _container.Resolve<T>();
}
public IEnumerable<T> BuildAll<T>() where T : class
public IEnumerable<T> BuildAll<T>()
where T : class
{
return _container.ResolveAll<T>().GroupBy(c => c.GetType().FullName).Select(g => g.First());
}
@@ -42,4 +46,4 @@ namespace NzbDrone.Common
return _container.GetImplementations(contract);
}
}
}
}