PageRenderTime 23ms CodeModel.GetById 18ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Source/Bifrost.WCF/Execution/ContainerInstanceProvider.cs

#
C# | 34 lines | 29 code | 5 blank | 0 comment | 0 complexity | 58a8c225935f78bb005402df4690468e MD5 | raw file
 1using System;
 2using System.ServiceModel;
 3using System.ServiceModel.Channels;
 4using System.ServiceModel.Dispatcher;
 5using Bifrost.Execution;
 6
 7namespace Bifrost.WCF.Execution
 8{
 9	public class ContainerInstanceProvider : IInstanceProvider
10	{
11		IContainer _container;
12		Type _serviceType;
13
14		public ContainerInstanceProvider(IContainer container, Type serviceType)
15		{
16			_container = container;
17			_serviceType = serviceType;
18		}
19
20		public object GetInstance(InstanceContext instanceContext, Message message)
21		{
22			return _container.Get(_serviceType);
23		}
24
25		public object GetInstance(InstanceContext instanceContext)
26		{
27			return GetInstance(instanceContext, null);
28		}
29
30		public void ReleaseInstance(InstanceContext instanceContext, object instance)
31		{
32		}
33	}
34}