Castle.Facilities.WcfIntegration.Proxy.MethodCallMessage.LogicalCallContextBuilder C# (CSharp) Method

LogicalCallContextBuilder() private static method

private static LogicalCallContextBuilder ( ) : Func
return Func
		private static Func<LogicalCallContext> LogicalCallContextBuilder()
		{
			var type = typeof(LogicalCallContext);
			var ctor = type.GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, Type.EmptyTypes, null);
			var creator = new DynamicMethod("CreateLogicalContext", type, null, type, true);
			var generator = creator.GetILGenerator();
			generator.Emit(OpCodes.Newobj, ctor);
			generator.Emit(OpCodes.Ret);
			return (Func<LogicalCallContext>)creator.CreateDelegate(typeof(Func<LogicalCallContext>));
		}
	}