Пример #1
0
 /// <summary>
 ///     Extends the <see cref="IOptional{TContract}.Resolve" /> method by resolving the default dependency (without key).
 /// </summary>
 /// <typeparam name="TContract">The type of the dependency.</typeparam>
 /// <param name="optional">The instance of <see cref="IOptional{TContract}" /> to extend.</param>
 /// <returns>An instance of the dependency or null if not registered.</returns>
 public static TContract Resolve <TContract>(this IOptional <TContract> optional) => optional.Resolve(null);
Пример #2
0
 public OptionalTest(IOptional <IOptionalContract> optionalContract)
 {
     OptionalContract = optionalContract.Resolve();
 }