Facade is a lightweight IoC library. It provides the ability to register objects, constructors, and methods. Both global and container specific service mapping is available, allowing for flexible service management.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
.Net Standard 2.0 (For library)
.Net Framework 4.6.1 (For test project)
Visual Studio 2017
NUnit 3 Test Adapter
Pull Master branch.
Open Solution in Visual Studio.
Build Solution (If necessary perform NuGet Restore).
Using Visual Studio Test Explorer, select Run All.
Container.RegisterGlobalType<IService, Service>( "Some Parameter" );
IService service = Container.ResolveGlobalType<IService>();
Container.RemoveGlobalTypeMapping<IService>();
Container container = new Container();
container.RegisterInstance<IService>( new Service( "Some Parameter" ) );
IService service = container.ResolveInstance<IService>();
string methodName = "greet";
var greeter = new Action<string>( ( name ) => Console.WriteLine( $"Greetings from {name}!" ) );
Container.RegisterGlobalMethod( methodName, greeter.Method, greeter.Target );
Container.InvokeGlobalMethod( methodName, "Alex" );
- Alex Harper - boscoton87
This project is licensed under the Apache-2.0 License.