-
-
Save juanplopes/806292 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MeuDependencyResolver : IDependencyResolver | |
{ | |
private ILookup<Type, object> dependencias; | |
public MeuDependencyResolver() | |
{ | |
this.dependencias = Dependencias().ToLookup(x => x.GetType()); | |
} | |
private IEnumerable<object> Depencencias() | |
{ | |
yield return new DummyDependencia1(); | |
yield return new DummyDependencia2(); | |
yield return new DummyDependencia2_2(); | |
} | |
public object GetService(Type serviceType) | |
{ | |
return dependencias[serviceType].FirstOrDefault(); | |
} | |
public IEnumerable<object> GetServices(Type serviceType) | |
{ | |
return dependencias[serviceType]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment