SmartDIExtensions.cs
/// <summary>
/// Provides a generic argument for the type to resolve.
/// Casts as the requested type upon return.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="diContainer">The di container.</param>
/// <param name="storageRule">The storage rule.</param>
/// <param name="boundInstance">The bound instance.</param>
/// <param name="conflictResolver">The conflict resolver.</param>
/// <returns>T.</returns>
Provides a generic argument for the type to resolve.
Casts as the requested type upon return.
Provides a generic argument for the type to resolve . Casts as the requested type upon return .
public static T Resolve<T>
      (
         this ISmartDIContainer diContainer,
         StorageRules storageRule =
            StorageRules.AnyAccessLevel,
         object                                                                           boundInstance    = null,
         Func<IDictionary<Type, ITimeStampedCreatorAndStorageRules>, IConflictResolution> conflictResolver = null
      )
         where T : class
      {
         var retInstance = diContainer.Resolve(typeof(T), storageRule, boundInstance, conflictResolver) as T;
         return retInstance;
      }
public static T Resolve < T > ( this ISmartDIContainer diContainer , StorageRules storageRule = StorageRules . AnyAccessLevel , object boundInstance = null , Func < IDictionary < Type , ITimeStampedCreatorAndStorageRules > , IConflictResolution > conflictResolver = null ) where T : class { var retInstance = diContainer . Resolve ( typeof ( T ) , storageRule , boundInstance , conflictResolver ) as T ; return retInstance ; }
Provides a generic argument for the type to resolve.
Provides a generic argument for the type to resolve .
None
ISmartDIContainer
this
storageRule
StorageRules
The storage rule.
The storage rule .
boundInstance
object
The bound instance.
The bound instance .
conflictResolver
Func<IDictionary<Type, ITimeStampedCreatorAndStorageRules>, IConflictResolution>
The conflict resolver.
The conflict resolver .
diContainer
The di container.
The di container .
typeparam
None