diff options
Diffstat (limited to 'slips/src/app/Marina/Infrastructure/Container/Custom/CustomDependencyContainer.cs')
| -rw-r--r-- | slips/src/app/Marina/Infrastructure/Container/Custom/CustomDependencyContainer.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/slips/src/app/Marina/Infrastructure/Container/Custom/CustomDependencyContainer.cs b/slips/src/app/Marina/Infrastructure/Container/Custom/CustomDependencyContainer.cs new file mode 100644 index 0000000..d37e452 --- /dev/null +++ b/slips/src/app/Marina/Infrastructure/Container/Custom/CustomDependencyContainer.cs @@ -0,0 +1,21 @@ +using System;
+using System.Collections.Generic;
+
+namespace Marina.Infrastructure.Container.Custom {
+ public class CustomDependencyContainer : IDependencyContainer {
+ private static IDictionary< Type, object > list;
+
+ public CustomDependencyContainer( ) {
+ list = new Dictionary< Type, object >( );
+ }
+
+ public Interface GetMeAnImplementationOfAn< Interface >( ) {
+ Type currentType = typeof( Interface );
+ return ( Interface )list[ currentType ];
+ }
+
+ public void AddImplementationOf< Interface >( Interface objectToRegister ) {
+ list.Add( typeof( Interface ), objectToRegister );
+ }
+ }
+}
\ No newline at end of file |
