About ExportFactory<T>

Mar 2, 2010 at 2:54 AM

In method:

public ExportLifetimeContext<T> CreateExport()
{
      Tuple<T, Action> untypedLifetimeContext = this._exportLifetimeContextCreator.Invoke();
      return new ExportLifetimeContext<T>(untypedLifetimeContext.Item1, untypedLifetimeContext.Item2);
}

I think it will be better if:

        public ExportLifetimeContext<T> CreateExport()
        {
            try
            {
                Tuple<T, Action> untypedLifetimeContext = this._exportLifetimeContextCreator.Invoke();
                return new ExportLifetimeContext<T>(untypedLifetimeContext.Item1, untypedLifetimeContext.Item2);
            }
            catch (TargetInvocationException e)
            {
                throw e.InnerException;
            }
        }
Otherwise 'CompositionException' will not be caught when using CreateExport()