summaryrefslogtreecommitdiff
path: root/slips/src/app/Marina/Infrastructure/Container/Resolve.cs
diff options
context:
space:
mode:
Diffstat (limited to 'slips/src/app/Marina/Infrastructure/Container/Resolve.cs')
-rw-r--r--slips/src/app/Marina/Infrastructure/Container/Resolve.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/slips/src/app/Marina/Infrastructure/Container/Resolve.cs b/slips/src/app/Marina/Infrastructure/Container/Resolve.cs
new file mode 100644
index 0000000..53e602b
--- /dev/null
+++ b/slips/src/app/Marina/Infrastructure/Container/Resolve.cs
@@ -0,0 +1,21 @@
+using System;
+
+namespace Marina.Infrastructure.Container {
+ public class Resolve {
+ private static IDependencyContainer container;
+
+ public static void InitializeWith( IDependencyContainer newContainer
+ ) {
+ container = newContainer;
+ }
+
+ public static Interface DependencyFor< Interface >() {
+ try {
+ return container.GetMeAnImplementationOfAn< Interface >( );
+ }
+ catch ( Exception e ) {
+ throw new InterfaceResolutionException( e, typeof( Interface ) );
+ }
+ }
+ }
+} \ No newline at end of file