summaryrefslogtreecommitdiff
path: root/slips/src/app/Marina/Infrastructure/Container/Resolve.cs
blob: 53e602b49332e72d7779ac3921d0a16b6c072911 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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 ) );
			}
		}
	}
}