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 User { } | |
public class Order { } | |
public interface ILoader<out T> | |
{ | |
IEnumerable<T> Load(); | |
} | |
public class UserLoader : ILoader<User> | |
{ |
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 interface ILoader<out T>{ | |
IEnumerable<T> Load(); | |
} |
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 User {} | |
public class UserLoader : ILoader<User> | |
{ | |
public IEnumerable<User> Load() | |
{ | |
//return Loaded users | |
} | |
} |
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
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 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 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 SimpleInterceptor : IInterceptor | |
{ | |
public void Intercept(IInvocation invocation) | |
{ | |
invocation.Proceed(); | |
} | |
} |
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
Windsor.InitialiseCore(); | |
Windsor.Container.Register(Component.For<IInterceptor>() | |
.ImplementedBy<SimpleInterceptor>()); |
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
[Interceptor(typeof(SimpleInterceptor))] | |
public class TestClass | |
{ | |
public virtual void DoStuff() | |
{ | |
//Do Important Stuff | |
} | |
} |
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
//install grunt command line interface(CLI) | |
npm install -g grunt-cli | |
//install grunt into the projects modules | |
npm install grunt --save-dev | |
//install JSHint package | |
npm install grunt-contrib-jshint --save-dev | |
//install Watch configuration |
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
module.exports = function(grunt) { | |
// configuration. | |
grunt.initConfig({ | |
//Package file | |
pkg: grunt.file.readJSON("package.json"), | |
//jshint - configuration | |
jshint: { | |
files: ["gruntfile.js", "index.js", "lib/**/*.js","test/**/*.js"], | |
options: { |
OlderNewer