/// <summary> /// Gets exported value or <c>null</c>. /// </summary> public static T TryGetExport <T>(this CompositionContext context) { T value; context.TryGetExport <T>(out value); return(value); }
T?IExportProvider.GetExportedValueOrDefault <T>([CanBeNull] string?contractName) where T : class { return(_context.TryGetExport <T>(contractName, out var value) ? value : default);