This file contains hidden or 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
var container = new WindsorContainer(); | |
container.Register(Component.For<ILoader<object>>().ImplementedBy<UserLoader>()); | |
covariantArray = container.ResolveAll<ILoader<object>>(); |
This file contains hidden or 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
var container = new WindsorContainer(); | |
container.Register(Classes.FromThisAssembly() | |
.BasedOn(typeof (ILoader<>)) | |
.WithService | |
.Select(new []{typeof(ILoader<object>)})); | |
covariantArray = container.ResolveAll<ILoader<object>>(); |
This file contains hidden or 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 User {} | |
public class UserLoader : ILoader<User> | |
{ | |
public IEnumerable<User> Load() | |
{ | |
//return Loaded users | |
} | |
} |
This file contains hidden or 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 interface ILoader<out T>{ | |
IEnumerable<T> Load(); | |
} |
This file contains hidden or 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 User { } | |
public class Order { } | |
public interface ILoader<out T> | |
{ | |
IEnumerable<T> Load(); | |
} | |
public class UserLoader : ILoader<User> | |
{ |
NewerOlder