Constants
using Stashbox.Attributes;
using Stashbox.Resolution;
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
namespace Stashbox.Utils
{
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(0)]
internal static class Constants
{
public static readonly Type StringType = typeof(string);
public static readonly Type ResolutionScopeType = typeof(IResolutionScope);
public static readonly Type ServiceProviderType = typeof(IServiceProvider);
public static readonly Type ResolverType = typeof(IDependencyResolver);
public static readonly Type RequestContextType = typeof(IRequestContext);
public static readonly Type InternalRequestContextType = typeof(IInternalRequestContext);
public static readonly Type ObjectType = typeof(object);
public static readonly Type VoidType = typeof(void);
public static readonly Type DelegateType = typeof(Delegate);
public static readonly ParameterExpression ResolutionScopeParameter = ResolutionScopeType.AsParameter("scope");
public static readonly ParameterExpression RequestContextParameter = RequestContextType.AsParameter("request");
public static readonly MethodInfo AddDisposalMethod = ResolutionScopeType.GetMethod("AddDisposableTracking");
public static readonly MethodInfo AddRequestContextAwareDisposalMethod = ResolutionScopeType.GetMethod("AddRequestContextAwareDisposableTracking");
public static readonly MethodInfo GetOrAddScopedObjectMethod = ResolutionScopeType.GetMethod("GetOrAddScopedObject");
public static readonly MethodInfo AddWithFinalizerMethod = ResolutionScopeType.GetMethod("AddWithFinalizer");
public static readonly MethodInfo AddWithAsyncInitializerMethod = ResolutionScopeType.GetMethod("AddWithAsyncInitializer");
public static readonly MethodInfo GetOrAddInstanceMethod = InternalRequestContextType.GetMethod("GetOrAddInstance");
public static readonly MethodInfo ResolveMethod = ResolverType.GetMethod("Resolve", new Type[3] {
typeof(Type),
ObjectType,
typeof(object[])
});
public static readonly MethodInfo BeginScopeMethod = ResolverType.GetMethod("BeginScope");
public static readonly Type DisposableType = typeof(IDisposable);
public static readonly Type AsyncDisposableType = typeof(IAsyncDisposable);
public static readonly Type FuncType = typeof(Func<>);
public static readonly Type[] EmptyTypes = EmptyArray<Type>();
public static readonly Type CompositionRootType = typeof(ICompositionRoot);
public static readonly Type DependencyAttributeType = typeof(Stashbox.Attributes.DependencyAttribute);
public static readonly Type InjectionAttributeType = typeof(InjectionMethodAttribute);
public const MethodImplOptions Inline = MethodImplOptions.AggressiveInlining;
public const byte DelegatePlaceholder = 0;
public static T[] EmptyArray<[System.Runtime.CompilerServices.Nullable(2)] T>()
{
return InternalArrayHelper<T>.Empty;
}
}
}