4 overrides of CreateDelegate
System.Private.CoreLib (2)
src\System\Reflection\Emit\DynamicMethod.CoreCLR.cs (1)
44public sealed override Delegate CreateDelegate(Type delegateType) =>
src\System\Reflection\RuntimeMethodInfo.CoreCLR.cs (1)
350public override Delegate CreateDelegate(Type delegateType)
System.Reflection.Context (1)
System\Reflection\Context\Delegation\DelegatingMethodInfo.cs (1)
169public override Delegate CreateDelegate(Type delegateType)
System.Reflection.MetadataLoadContext (1)
System\Reflection\TypeLoading\Methods\RoMethod.cs (1)
125public sealed override Delegate CreateDelegate(Type delegateType) => throw new InvalidOperationException(SR.Arg_InvalidOperation_Reflection);
64 references to CreateDelegate
Aspire.Confluent.Kafka (1)
src\Vendoring\OpenTelemetry.Instrumentation.ConfluentKafka\Shared\PropertyFetcher.AOT.cs (1)
192this.propertyFetch = (Func<TDeclaredObject, T>)property.GetMethod!.CreateDelegate(typeof(Func<TDeclaredObject, T>));
Aspire.Microsoft.Data.SqlClient (1)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\PropertyFetcher.cs (1)
188this.propertyFetch = (Func<TDeclaredObject, T>)property.GetMethod!.CreateDelegate(typeof(Func<TDeclaredObject, T>));
Aspire.Microsoft.EntityFrameworkCore.SqlServer (1)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\PropertyFetcher.cs (1)
188this.propertyFetch = (Func<TDeclaredObject, T>)property.GetMethod!.CreateDelegate(typeof(Func<TDeclaredObject, T>));
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Shared\PropertyFetcher.AOT.cs (1)
194this.propertyFetch = (Func<TDeclaredObject, T>)property.GetMethod!.CreateDelegate(typeof(Func<TDeclaredObject, T>));
dotnet-svcutil-lib (2)
FrameworkFork\Microsoft.Xml\Xml\Core\SecureStringHasher.cs (2)
99s_hashCodeDelegate1 = (HashCodeOfStringDelegate1)getHashCodeMethodInfo.CreateDelegate(typeof(HashCodeOfStringDelegate1)); 103s_hashCodeDelegate3 = (HashCodeOfStringDelegate3)getHashCodeMethodInfo.CreateDelegate(typeof(HashCodeOfStringDelegate3));
Microsoft.AspNetCore.Components (2)
Reflection\PropertyGetter.cs (1)
35getMethod.CreateDelegate(typeof(Func<,>).MakeGenericType(targetType, property.PropertyType));
Reflection\PropertySetter.cs (1)
35setMethod.CreateDelegate(typeof(Action<,>).MakeGenericType(targetType, property.PropertyType));
Microsoft.AspNetCore.Components.Endpoints (2)
src\Shared\PropertyHelper\PropertyHelper.cs (2)
252var propertyGetterDelegate = propertyGetMethod.CreateDelegate(delegateType); 295setMethod.CreateDelegate(typeof(Action<,>).MakeGenericType(typeInput, parameterType));
Microsoft.AspNetCore.Components.WebAssembly (2)
HotReload\HotReloadAgent.cs (1)
80applyUpdate = (ApplyUpdateDelegate)applyUpdateMethod.CreateDelegate(typeof(ApplyUpdateDelegate));
HotReload\MetadataUpdateHandlerInvoker.cs (1)
155var action = (Action<Type[]?>)update.CreateDelegate(typeof(Action<Type[]?>));
Microsoft.AspNetCore.Http.Abstractions (2)
src\Shared\PropertyHelper\PropertyHelper.cs (2)
252var propertyGetterDelegate = propertyGetMethod.CreateDelegate(delegateType); 295setMethod.CreateDelegate(typeof(Action<,>).MakeGenericType(typeInput, parameterType));
Microsoft.AspNetCore.Mvc.Core (2)
src\Shared\PropertyHelper\PropertyHelper.cs (2)
252var propertyGetterDelegate = propertyGetMethod.CreateDelegate(delegateType); 295setMethod.CreateDelegate(typeof(Action<,>).MakeGenericType(typeInput, parameterType));
Microsoft.AspNetCore.Mvc.NewtonsoftJson (2)
BsonTempDataSerializer.cs (2)
71.CreateDelegate(typeof(Func<JArray, object>)); 98.CreateDelegate(typeof(Func<JObject, object>));
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
TryGetValueProvider.cs (1)
61result = (TryGetValueDelegate)implementationMethod.CreateDelegate(typeof(TryGetValueDelegate));
Microsoft.AspNetCore.Routing (2)
src\Shared\PropertyHelper\PropertyHelper.cs (2)
252var propertyGetterDelegate = propertyGetMethod.CreateDelegate(delegateType); 295setMethod.CreateDelegate(typeof(Action<,>).MakeGenericType(typeInput, parameterType));
Microsoft.AspNetCore.Routing.Abstractions (2)
src\Shared\PropertyHelper\PropertyHelper.cs (2)
252var propertyGetterDelegate = propertyGetMethod.CreateDelegate(delegateType); 295setMethod.CreateDelegate(typeof(Action<,>).MakeGenericType(typeInput, parameterType));
Microsoft.AspNetCore.Shared.Tests (2)
src\Shared\PropertyHelper\PropertyHelper.cs (2)
252var propertyGetterDelegate = propertyGetMethod.CreateDelegate(delegateType); 295setMethod.CreateDelegate(typeof(Action<,>).MakeGenericType(typeInput, parameterType));
Microsoft.AspNetCore.SignalR.Core (1)
Internal\TypedClientBuilder.cs (1)
46return (Func<IClientProxy, T>)factoryMethod!.CreateDelegate(typeof(Func<IClientProxy, T>));
Microsoft.Build (1)
Evaluation\Expander.cs (1)
2288transformFunction = (ItemTransformFunction)itemFunctionInfo.CreateDelegate(typeof(ItemTransformFunction));
Microsoft.Build.Tasks.CodeAnalysis (1)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
115return (T)methodInfo.CreateDelegate(typeof(T));
Microsoft.CodeAnalysis (3)
DiaSymReader\SymUnmanagedFactory.cs (1)
88return (Func<string, string>)method.CreateDelegate(typeof(Func<string, string>));
InternalUtilities\ReflectionUtilities.cs (1)
115return (T)methodInfo.CreateDelegate(typeof(T));
InternalUtilities\UICultureUtilities.cs (1)
46setter = (Action<CultureInfo>)currentUICultureSetter.CreateDelegate(typeof(Action<CultureInfo>));
Microsoft.CodeAnalysis.CodeStyle (1)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
115return (T)methodInfo.CreateDelegate(typeof(T));
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (1)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
115return (T)methodInfo.CreateDelegate(typeof(T));
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
115return (T)methodInfo.CreateDelegate(typeof(T));
Microsoft.CodeAnalysis.Workspaces (1)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
115return (T)methodInfo.CreateDelegate(typeof(T));
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (2)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
115return (T)methodInfo.CreateDelegate(typeof(T));
src\Compilers\Core\Portable\InternalUtilities\UICultureUtilities.cs (1)
46setter = (Action<CultureInfo>)currentUICultureSetter.CreateDelegate(typeof(Action<CultureInfo>));
System.Composition.Hosting (1)
System\Composition\Hosting\Util\MethodInfoExtensions.cs (1)
12return (T)(object)methodInfo.CreateDelegate(typeof(T));
System.Diagnostics.DiagnosticSource (2)
System\Diagnostics\DsesFilterAndTransform.cs (2)
845_propertyFetch = (Func<TObject, TProperty>)property.GetMethod!.CreateDelegate(typeof(Func<TObject, TProperty>)); 864_propertyFetch = (StructFunc<TStruct, TProperty>)property.GetMethod!.CreateDelegate(typeof(StructFunc<TStruct, TProperty>));
System.Linq.Expressions (14)
System\Linq\Expressions\Interpreter\CallInstruction.Generated.cs (10)
226_target = (Action)target.CreateDelegate(typeof(Action)); 249_target = (Action<T0>)target.CreateDelegate(typeof(Action<T0>)); 288_target = (Action<T0, T1>)target.CreateDelegate(typeof(Action<T0, T1>)); 327_target = (Action<T0, T1, T2>)target.CreateDelegate(typeof(Action<T0, T1, T2>)); 366_target = (Action<T0, T1, T2, T3>)target.CreateDelegate(typeof(Action<T0, T1, T2, T3>)); 403_target = (Func<TRet>)target.CreateDelegate(typeof(Func<TRet>)); 426_target = (Func<T0, TRet>)target.CreateDelegate(typeof(Func<T0, TRet>)); 467_target = (Func<T0, T1, TRet>)target.CreateDelegate(typeof(Func<T0, T1, TRet>)); 508_target = (Func<T0, T1, T2, TRet>)target.CreateDelegate(typeof(Func<T0, T1, T2, TRet>)); 549_target = (Func<T0, T1, T2, T3, TRet>)target.CreateDelegate(typeof(Func<T0, T1, T2, T3, TRet>));
System\Linq\Expressions\LambdaExpression.cs (1)
638factories[delegateType] = fastPath = (Func<Expression, string?, bool, ReadOnlyCollection<ParameterExpression>, LambdaExpression>)create.CreateDelegate(typeof(Func<Expression, string?, bool, ReadOnlyCollection<ParameterExpression>, LambdaExpression>));
System\Runtime\CompilerServices\CallSite.cs (3)
110ctor = (Func<CallSiteBinder, CallSite>)method.CreateDelegate(typeof(Func<CallSiteBinder, CallSite>)); 325s_cachedNoMatch = (T)(object)noMatchMethod!.MakeGenericMethod(args).CreateDelegate(target); 326return (T)(object)method.MakeGenericMethod(args).CreateDelegate(target);
System.Net.HttpListener (4)
System\Net\Windows\CookieExtensions.cs (4)
17s_toServerStringFunc ??= (Func<Cookie, string>)typeof(Cookie).GetMethod("ToServerString", BindingFlags.Instance | BindingFlags.NonPublic)?.CreateDelegate(typeof(Func<Cookie, string>))!; 26s_cloneFunc ??= (Func<Cookie, Cookie>)typeof(Cookie).GetMethod("Clone", BindingFlags.Instance | BindingFlags.NonPublic)?.CreateDelegate(typeof(Func<Cookie, Cookie>))!; 44s_getVariantFunc ??= (Func<Cookie, CookieVariant>)typeof(Cookie).GetProperty("Variant", BindingFlags.Instance | BindingFlags.NonPublic)?.GetGetMethod(true)?.CreateDelegate(typeof(Func<Cookie, CookieVariant>))!; 56s_internalAddFunc ??= (Func<CookieCollection, Cookie, bool, int>)typeof(CookieCollection).GetMethod("InternalAdd", BindingFlags.Instance | BindingFlags.NonPublic)?.CreateDelegate(typeof(Func<CookieCollection, Cookie, bool, int>))!;
System.Private.CoreLib (2)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\PropertyValue.cs (1)
207return property.GetMethod!.CreateDelegate(typeof(Func<,>).MakeGenericType(property.DeclaringType!, propertyType));
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInfo.cs (1)
33public T CreateDelegate<T>() where T : Delegate => (T)CreateDelegate(typeof(T));
System.Private.Xml (1)
System\Xml\Xsl\IlGen\XmlILModule.cs (1)
265return ((MethodInfo)_methods[name]!).CreateDelegate(typDelegate);
System.Reflection.Context (1)
System\Reflection\Context\Delegation\DelegatingMethodInfo.cs (1)
171return UnderlyingMethod.CreateDelegate(delegateType);
System.Text.Json (2)
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (2)
132return (Func<IEnumerable<TElement>, TCollection>)createRange.CreateDelegate( 139return (Func<IEnumerable<KeyValuePair<TKey, TValue>>, TCollection>)createRange.CreateDelegate(