Created
June 1, 2016 05:27
-
-
Save rohits79/eb7e995e20ee91e1555d42dfe11422b5 to your computer and use it in GitHub Desktop.
Caliburn Static IOC
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 static class IoC { | |
/// <summary> | |
/// Gets an instance by type and key. | |
/// </summary> | |
public static Func<Type, string, object> GetInstance = (service, key) => { throw new InvalidOperationException("IoC is not initialized."); }; | |
/// <summary> | |
/// Gets all instances of a particular type. | |
/// </summary> | |
public static Func<Type, IEnumerable<object>> GetAllInstances = service => { throw new InvalidOperationException("IoC is not initialized."); }; | |
/// <summary> | |
/// Passes an existing instance to the IoC container to enable dependencies to be injected. | |
/// </summary> | |
public static Action<object> BuildUp = instance => { throw new InvalidOperationException("IoC is not initialized."); }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment