178 references to GetMethod
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 (9)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ClassDataContract.cs (2)
962MethodInfo getMethod = property.GetMethod; 1026MethodInfo getMethod = property.GetMethod;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (2)
712MethodInfo getMethod = property.GetMethod; 1644private static MethodInfo s_stringLength = typeof(string).GetProperty("Length").GetMethod;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataMember.cs (1)
322MethodInfo getMethod = property.GetMethod;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExceptionDataContract.cs (1)
472MethodInfo messageGetter = messageProperty.GetMethod;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (3)
127s_ienumeratorGetCurrentMethod = typeof(IEnumerator).GetProperty("Current").GetMethod; 143s_getItemContractMethod = typeof(CollectionDataContract).GetProperty("ItemContract", Globals.ScanAllMembers).GetMethod; 621s_getArrayLengthMethod = Globals.TypeOfArray.GetProperty("Length").GetMethod;
Infrastructure.Common (4)
xunit\ConditionAttribute.cs (4)
117if (pi != null && pi.PropertyType == typeof(bool) && pi.GetMethod != null && pi.GetMethod.IsStatic && pi.GetMethod.GetParameters().Length == 0) 118return pi.GetMethod;
Metrics (1)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
71Expression result = Expression.Call(instance, property.GetMethod!);
Metrics.Legacy (1)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
71Expression result = Expression.Call(instance, property.GetMethod!);
Microsoft.AspNetCore.Components (8)
PersistentState\PersistentServicesRegistry.cs (2)
192if (propertyInfo.GetMethod == null || !propertyInfo.GetMethod.IsPublic)
Reflection\MemberAssignment.cs (4)
70return single.GetMethod?.GetBaseDefinition() == property.GetMethod?.GetBaseDefinition(); 76if (other.GetMethod?.GetBaseDefinition() == property.GetMethod?.GetBaseDefinition())
Reflection\PropertyGetter.cs (2)
23if (property.GetMethod == null) 32var getMethod = property.GetMethod;
Microsoft.AspNetCore.Components.Endpoints (5)
src\Shared\PropertyHelper\PropertyHelper.cs (5)
207var getMethod = propertyInfo.GetMethod; 543property.GetMethod != null && 544property.GetMethod.IsPublic && 545!property.GetMethod.IsStatic && 554property.GetMethod.GetParameters().Length == 0;
Microsoft.AspNetCore.Components.Forms (1)
src\Components\Shared\src\ExpressionFormatting\ExpressionFormatter.cs (1)
191property.GetMethod == methodInfo)
Microsoft.AspNetCore.Components.Web (1)
src\Components\Shared\src\ExpressionFormatting\ExpressionFormatter.cs (1)
191property.GetMethod == methodInfo)
Microsoft.AspNetCore.Http.Abstractions (5)
src\Shared\PropertyHelper\PropertyHelper.cs (5)
207var getMethod = propertyInfo.GetMethod; 543property.GetMethod != null && 544property.GetMethod.IsPublic && 545!property.GetMethod.IsStatic && 554property.GetMethod.GetParameters().Length == 0;
Microsoft.AspNetCore.Mvc.Core (6)
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (1)
367if (propertyHelper.Property.CanRead && propertyHelper.Property.GetMethod?.IsPublic == true)
src\Shared\PropertyHelper\PropertyHelper.cs (5)
207var getMethod = propertyInfo.GetMethod; 543property.GetMethod != null && 544property.GetMethod.IsPublic && 545!property.GetMethod.IsStatic && 554property.GetMethod.GetParameters().Length == 0;
Microsoft.AspNetCore.Mvc.ViewFeatures (3)
ExpressionHelper.cs (1)
256property.GetMethod == methodExpression.Method))
Filters\SaveTempDataPropertyFilterBase.cs (2)
124property.GetMethod != null && 125property.GetMethod.IsPublic))
Microsoft.AspNetCore.Routing (5)
src\Shared\PropertyHelper\PropertyHelper.cs (5)
207var getMethod = propertyInfo.GetMethod; 543property.GetMethod != null && 544property.GetMethod.IsPublic && 545!property.GetMethod.IsStatic && 554property.GetMethod.GetParameters().Length == 0;
Microsoft.AspNetCore.Routing.Abstractions (5)
src\Shared\PropertyHelper\PropertyHelper.cs (5)
207var getMethod = propertyInfo.GetMethod; 543property.GetMethod != null && 544property.GetMethod.IsPublic && 545!property.GetMethod.IsStatic && 554property.GetMethod.GetParameters().Length == 0;
Microsoft.AspNetCore.Shared.Tests (5)
src\Shared\PropertyHelper\PropertyHelper.cs (5)
207var getMethod = propertyInfo.GetMethod; 543property.GetMethod != null && 544property.GetMethod.IsPublic && 545!property.GetMethod.IsStatic && 554property.GetMethod.GetParameters().Length == 0;
Microsoft.AspNetCore.SignalR.Core (1)
Internal\TypedClientBuilder.cs (1)
230generator.Emit(OpCodes.Call, CancellationTokenNoneProperty.GetMethod!);
Microsoft.CodeAnalysis (1)
InternalUtilities\UICultureUtilities.cs (1)
71var currentThreadGetter = typeInfo.GetDeclaredProperty(currentThreadName)?.GetMethod;
Microsoft.CodeAnalysis.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
71Expression result = Expression.Call(instance, property.GetMethod!);
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
71Expression result = Expression.Call(instance, property.GetMethod!);
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
71Expression result = Expression.Call(instance, property.GetMethod!);
Microsoft.CodeAnalysis.EditorFeatures (1)
Lightup\LightupHelpers.cs (1)
94Expression.Convert(Expression.Call(instance, property.GetMethod), typeof(TResult)),
Microsoft.CodeAnalysis.PublicApiAnalyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
71Expression result = Expression.Call(instance, property.GetMethod!);
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
71Expression result = Expression.Call(instance, property.GetMethod!);
Microsoft.CodeAnalysis.Scripting (6)
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (3)
336members.AddRange(type.DeclaredProperties.Where(f => f.GetMethod != null && !f.GetMethod.IsStatic)); 385var getter = property.GetMethod;
Hosting\ObjectFormatter\ObjectFormatterHelpers.cs (3)
153var getter = property.GetMethod; 214var getter = ((PropertyInfo)member).GetMethod; 261if (property.GetMethod == null)
Microsoft.CodeAnalysis.Test.Utilities (2)
ReflectionAssert.cs (2)
20properties.Where(p => p.GetMethod != null && !p.GetMethod.IsPrivate).Select(p => p.Name)).
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
src\Compilers\Core\Portable\InternalUtilities\UICultureUtilities.cs (1)
71var currentThreadGetter = typeInfo.GetDeclaredProperty(currentThreadName)?.GetMethod;
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Options\OptionsTestInfo.cs (1)
61var isPublic = type.IsPublic && (isBackingField ? type.GetProperty(unmangledName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static)!.GetMethod!.IsPublic : field.IsPublic);
Microsoft.CSharp (3)
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (3)
1259if (property.GetMethod != null || property.SetMethod != null) 1261MethodInfo accessor = property.GetMethod ?? property.SetMethod; // Must have at least one. 1269MethodInfo methGet = property.GetMethod;
Microsoft.DotNet.XUnitExtensions (3)
src\Microsoft.DotNet.XUnitExtensions.Shared\Discoverers\ConditionalTestDiscoverer.cs (3)
160if (pi != null && pi.PropertyType == typeof(bool) && pi.GetMethod != null && pi.GetMethod.IsStatic && pi.GetMethod.GetParameters().Length == 0)
Microsoft.DotNet.XUnitV3Extensions (3)
src\Microsoft.DotNet.XUnitExtensions.Shared\Discoverers\ConditionalTestDiscoverer.cs (3)
160if (pi != null && pi.PropertyType == typeof(bool) && pi.GetMethod != null && pi.GetMethod.IsStatic && pi.GetMethod.GetParameters().Length == 0)
Microsoft.Extensions.AI (1)
Functions\AIFunctionFactory.cs (1)
1152private static readonly MethodInfo _taskGetResult = typeof(Task<>).GetProperty(nameof(Task<int>.Result), BindingFlags.Instance | BindingFlags.Public)!.GetMethod!;
Microsoft.Extensions.Configuration.Binder (8)
ConfigurationBinder.cs (8)
277if (property.GetMethod is null || 279(!options.BindNonPublicProperties && (!property.GetMethod.IsPublic || !property.SetMethod.IsPublic)) || 280property.GetMethod.GetParameters().Length > 0) 293if (property.GetMethod == null || 294(!options.BindNonPublicProperties && !property.GetMethod.IsPublic) || 295property.GetMethod.GetParameters().Length > 0) 666object? k = keyMethod.GetMethod!.Invoke(item, null); 667object? v = valueMethod.GetMethod!.Invoke(item, null);
Microsoft.Extensions.DependencyInjection (4)
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (4)
19nameof(ServiceProviderEngineScope.ResolvedServices), BindingFlags.Instance | BindingFlags.NonPublic)!.GetMethod!; 22nameof(ServiceProviderEngineScope.Sync), BindingFlags.Instance | BindingFlags.NonPublic)!.GetMethod!; 25nameof(ServiceProviderEngineScope.IsRootScope), BindingFlags.Instance | BindingFlags.Public)!.GetMethod!; 31nameof(CallSiteRuntimeResolver.Instance), BindingFlags.Static | BindingFlags.Public | BindingFlags.Instance)!.GetMethod!;
Microsoft.Extensions.Options.DataAnnotations (2)
DataAnnotationValidateOptions.cs (2)
99if (propertyInfo.GetMethod is null || propertyInfo.GetMethod.GetParameters().Length > 0)
Microsoft.Maui (1)
Converters\KeyboardTypeConverter.cs (1)
35 PropertyInfo? property = kbType.GetProperties()?.FirstOrDefault(pi => pi != null && pi.Name == keyboard && pi.CanRead && (pi.GetMethod?.IsStatic ?? false));
Microsoft.Maui.Controls (10)
BindingExpression.cs (4)
276 if (pi.CanRead && pi.GetMethod.GetParameters()[0].ParameterType == typeof(int)) 289 if (pi.CanRead && pi.GetMethod.GetParameters()[0].ParameterType == typeof(string)) 300 if (pi.CanRead && pi.GetMethod.GetParameters()[0].ParameterType == typeof(object)) 394 if (property is { CanRead: true, GetMethod: { IsPublic: true, IsStatic: false } propertyGetMethod })
LegacyLayouts\ConstraintExpression.cs (4)
43 minfo = typeof(View).GetProperties().First(pi => pi.Name == Property && pi.CanRead && pi.GetMethod.IsPublic).GetMethod; 52 minfo = typeof(View).GetProperties().First(pi => pi.Name == Property && pi.CanRead && pi.GetMethod.IsPublic).GetMethod;
PlatformBindingHelpers.cs (2)
46 var defaultValue = targetPropertyInfo?.GetMethod.Invoke(target, Array.Empty<object>()); 95 SetValueFromRenderer(proxy, bindableProperty, target.GetType().GetProperty(targetProperty)?.GetMethod.Invoke(target, Array.Empty<object>()));
Microsoft.Maui.Controls.Xaml (3)
ApplyPropertiesVisitor.cs (1)
709 if (propertyInfo == null || !propertyInfo.CanRead || (getter = propertyInfo.GetMethod) == null)
MarkupExtensions\StaticExtension.cs (2)
32 var pinfo = type.GetRuntimeProperties().FirstOrDefault(pi => pi.Name == membername && pi.GetMethod.IsStatic); 34 return pinfo.GetMethod.Invoke(null, Array.Empty<object>());
Roslyn.Diagnostics.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
71Expression result = Expression.Call(instance, property.GetMethod!);
System.ComponentModel.Annotations (4)
System\ComponentModel\DataAnnotations\LocalizableString.cs (1)
141var getter = property.GetMethod;
System\ComponentModel\DataAnnotations\ValidationAttribute.cs (1)
271var propertyGetter = property.GetMethod;
System\ComponentModel\DataAnnotations\ValidationAttributeStore.cs (2)
143(p.GetMethod != null && p.GetMethod.IsPublic) || (p.SetMethod != null && p.SetMethod.IsPublic);
System.Composition.Hosting (3)
System\Composition\Hosting\Providers\Metadata\MetadataViewProvider.cs (3)
54prop.GetMethod != null && prop.GetMethod.IsPublic && !prop.GetMethod.IsStatic &&
System.Composition.TypedParts (3)
System\Composition\TypedParts\ContractHelpers.cs (1)
73.Where(p => p.GetMethod.IsPublic && p.DeclaringType == attrType && p.CanRead))
System\Composition\TypedParts\Discovery\TypeInspector.cs (2)
79.Where(pi => pi.CanRead && pi.GetMethod.IsPublic && !pi.GetMethod.IsStatic))
System.Diagnostics.DiagnosticSource (6)
System\Diagnostics\DsesFilterAndTransform.cs (6)
790else if (propertyInfo.GetMethod?.IsStatic == true || propertyInfo.SetMethod?.IsStatic == true) 845_propertyFetch = (Func<TObject, TProperty>)property.GetMethod!.CreateDelegate(typeof(Func<TObject, TProperty>)); 864_propertyFetch = (StructFunc<TStruct, TProperty>)property.GetMethod!.CreateDelegate(typeof(StructFunc<TStruct, TProperty>)); 886_getterInvoker = MethodInvoker.Create(property.GetMethod!); 1026if (property.GetMethod == null || property.GetMethod!.GetParameters().Length > 0)
System.Private.CoreLib (2)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\PropertyValue.cs (2)
207return property.GetMethod!.CreateDelegate(typeof(Func<,>).MakeGenericType(property.DeclaringType!, propertyType)); 214property.GetMethod!.CreateDelegate<Func<TContainer, TProperty>>();
System.Private.DataContractSerialization (8)
System\Runtime\Serialization\AccessorBuilder.cs (2)
169var getMethod = propInfo.GetMethod!.CreateDelegate<StructGetDelegate<DeclaringType, PropertyType>>(); 179var getMethod = propInfo.GetMethod!.CreateDelegate<Func<DeclaringType, PropertyType>>();
System\Runtime\Serialization\ClassDataContract.cs (1)
832MethodInfo? getMethod = property.GetMethod;
System\Runtime\Serialization\CodeGenerator.cs (2)
589MethodInfo? getMethod = property.GetMethod; 1248private static readonly MethodInfo s_stringLength = typeof(string).GetProperty("Length")!.GetMethod!;
System\Runtime\Serialization\DataMember.cs (1)
257MethodInfo? getMethod = property.GetMethod;
System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (2)
127s_getItemContractMethod = typeof(CollectionDataContract).GetProperty("ItemContract", Globals.ScanAllMembers)!.GetMethod; 634s_getArrayLengthMethod = typeof(Array).GetProperty("Length")!.GetMethod;
System.Private.Xml (10)
System\Xml\Serialization\CodeGenerator.cs (3)
513result = currentProperty.GetMethod; 557MethodInfo? getMethod = property.GetMethod ?? GetPropertyMethodFromBaseType(property, true); 590MethodInfo? getMethod = property.GetMethod ?? GetPropertyMethodFromBaseType(property, true);
System\Xml\Serialization\Models.cs (1)
251MethodInfo getMethod = propertyInfo.GetMethod!;
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (2)
1463if (memberInfo is PropertyInfo propInfo && propInfo.GetMethod == null) 1471if (mi is PropertyInfo pi && pi.GetMethod != null && pi.PropertyType == propInfo.PropertyType)
System\Xml\Serialization\Types.cs (4)
1208if (info.GetMethod != null && !info.GetMethod!.IsPublic 1210&& ((PropertyInfo)memberInfoToBeReplaced).GetMethod!.IsPublic 1357MethodInfo getMethod = defaultProp.GetMethod!;
System.Reflection.DispatchProxy (4)
System\Reflection\DispatchProxyGenerator.cs (4)
325var ai = new PropertyAccessorInfo(pi.GetMethod, pi.SetMethod); 326if (pi.GetMethod != null) 327propertyMap[pi.GetMethod] = ai; 375PropertyAccessorInfo ai = propertyMap[pi.GetMethod ?? pi.SetMethod!];
System.Reflection.Emit (2)
System\Reflection\Emit\ModuleBuilderImpl.cs (1)
277if (property.GetMethod is MethodBuilderImpl gMb)
System\Reflection\Emit\TypeBuilderImpl.cs (1)
992MethodInfo? getMethod = property.GetMethod;
System.Reflection.MetadataLoadContext (2)
System\Reflection\Runtime\BindingFlagSupport\PropertyPolicies.cs (1)
85property.GetMethod ?? property.SetMethod;
System\Reflection\TypeLoading\Properties\RoProperty.cs (1)
106public sealed override bool CanRead => GetMethod != null;
System.Text.Json (5)
src\libraries\System.Text.Json\Common\ReflectionExtensions.cs (1)
221return propertyInfo.GetMethod?.IsVirtual == true || propertyInfo.SetMethod?.IsVirtual == true;
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (2)
166if (propertyInfo.GetMethod?.IsPublic == true || 417MethodInfo? getMethod = propertyInfo.GetMethod;
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (1)
235MethodInfo? realMethod = propertyInfo.GetMethod;
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (1)
145MethodInfo getMethodInfo = propertyInfo.GetMethod!;
Test.Utilities (1)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
71Expression result = Expression.Call(instance, property.GetMethod!);
Text.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
71Expression result = Expression.Call(instance, property.GetMethod!);
xunit.assert (7)
Sdk\ArgumentFormatter.cs (3)
342 .Where(p => p.GetMethod != null && p.GetMethod.IsPublic && !p.GetMethod.IsStatic)
Sdk\AssertHelper.cs (4)
153 && p.GetMethod != null 154 && p.GetMethod.IsPublic 155 && !p.GetMethod.IsStatic 158 && !p.GetMethod.GetCustomAttributes(typeof(ObsoleteAttribute)).Any()