SimpleContainer
Assembly: ServiceStack.Common.dll
View Source
Declaration
public class SimpleContainer : IContainer, IResolver
Properties
IgnoreTypesNamed
View Source
Declaration
public HashSet<string> IgnoreTypesNamed { get; }
Fields
InstanceCache
View Source
Declaration
protected readonly ConcurrentDictionary<Type, object> InstanceCache
Factory
View Source
Declaration
protected readonly ConcurrentDictionary<Type, Func<object>> Factory
Methods
Resolve(Type)
View Source
Declaration
public object Resolve(Type type)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Type | type |
Exists(Type)
View Source
Declaration
public bool Exists(Type type)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Type | type |
RequiredResolve(Type, Type)
View Source
Declaration
public object RequiredResolve(Type type, Type ownerType)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Type | type |
System.Type | ownerType |
AddSingleton(Type, Func<Object>)
View Source
Declaration
public IContainer AddSingleton(Type type, Func<object> factory)
Returns
Parameters
Type | Name |
---|---|
System.Type | type |
System.Func<System.Object> | factory |
AddTransient(Type, Func<Object>)
View Source
Declaration
public IContainer AddTransient(Type type, Func<object> factory)
Returns
Parameters
Type | Name |
---|---|
System.Type | type |
System.Func<System.Object> | factory |
TryResolve<T>()
View Source
Declaration
public T TryResolve<T>()
Returns
<T>
Type Parameters
T
IncludeProperty(PropertyInfo)
View Source
Declaration
protected virtual bool IncludeProperty(PropertyInfo pi)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Reflection.PropertyInfo | pi |
ResolveBestConstructor(Type)
View Source
Declaration
protected virtual ConstructorInfo ResolveBestConstructor(Type type)
Returns
System.Reflection.ConstructorInfo
Parameters
Type | Name |
---|---|
System.Type | type |
CreateFactory(Type)
View Source
Declaration
public Func<object> CreateFactory(Type type)
Returns
System.Func<System.Object>
Parameters
Type | Name |
---|---|
System.Type | type |
Dispose()
View Source
Declaration
public void Dispose()