src/Topelab.Core.Resolver/Entities/ResolveInfoCollection.cs
/// <summary>
/// Add types from with instance with key
/// </summary>
/// <typeparam name="TFrom">Type from (Interface)</typeparam>
/// <typeparam name="TTo">Type to (Implementation)</typeparam>
/// <param name="key">Key to resolve</param>
/// <param name="instance">Instance</param>
Add types from with instance with key
Add types from with instance with key
public ResolveInfoCollection AddInstance<TFrom, TTo>(string key, TTo instance)
        {
            ResolveInfo resolveInfo = new(typeof(TFrom), typeof(TTo), ResolveModeEnum.Instance, ResolveLifeCycleEnum.Singleton, key) { Instance = instance };
            Add(resolveInfo);
            return this;
        }
public ResolveInfoCollection AddInstance < TFrom , TTo > ( string key , TTo instance ) { ResolveInfo resolveInfo = new ( typeof ( TFrom ) , typeof ( TTo ) , ResolveModeEnum . Instance , ResolveLifeCycleEnum . Singleton , key ) { Instance = instance } ; Add ( resolveInfo ) ; return this ; }
Add types from with instance with key
Add types from with instance with key
key
string
Key to resolve
Key to resolve
instance
TTo
None
typeparam
Type from (Interface)
Type from ( Interface )
typeparam
Type to (Implementation)
Type to ( Implementation )