1 override of GetMethod
System.Private.CoreLib (1)
System\Reflection\Runtime\PropertyInfos\RuntimePropertyInfo.cs (1)
113public sealed override MethodInfo GetMethod
164 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.Hosting.RemoteHost (4)
AtsCapabilityScanner.cs (4)
1218if (property.GetMethod is not { IsStatic: true, IsPublic: true }) 1565var isStatic = property.GetMethod?.IsStatic ?? property.SetMethod?.IsStatic ?? false; 1585var isPublic = property.GetMethod?.IsPublic == true; 1950var isPublic = property.GetMethod?.IsPublic == true;
Aspire.Hosting.Tests (1)
ResourceNotificationTests.cs (1)
1662property.GetMethod?.IsDefined(typeof(CompilerGeneratedAttribute), inherit: false) is not true)
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Shared\PropertyFetcher.cs (1)
185this.propertyFetch = property.GetMethod!.CreateDelegate<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;
Microsoft.AspNetCore.Components (10)
PersistentState\PersistentServicesRegistry.cs (2)
213if (propertyInfo.GetMethod == null || !propertyInfo.GetMethod.IsPublic)
PersistentState\PersistentValueProviderComponentSubscription.cs (2)
232if (propertyInfo == null || propertyInfo.GetMethod == null || !propertyInfo.GetMethod.IsPublic)
Reflection\MemberAssignment.cs (4)
70return single.GetMethod?.GetBaseDefinition() == property.GetMethod?.GetBaseDefinition(); 76if (other.GetMethod?.GetBaseDefinition() == property.GetMethod?.GetBaseDefinition())
src\aspnetcore\src\Components\Shared\src\Reflection\PropertyGetter.cs (2)
27if (property.GetMethod == null) 36var getMethod = property.GetMethod;
Microsoft.AspNetCore.Components.Endpoints (7)
src\aspnetcore\src\Components\Shared\src\Reflection\PropertyGetter.cs (2)
27if (property.GetMethod == null) 36var getMethod = property.GetMethod;
src\aspnetcore\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\aspnetcore\src\Components\Shared\src\ExpressionFormatting\ExpressionFormatter.cs (1)
195property.GetMethod == methodInfo)
Microsoft.AspNetCore.Components.Web (1)
src\aspnetcore\src\Components\Shared\src\ExpressionFormatting\ExpressionFormatter.cs (1)
195property.GetMethod == methodInfo)
Microsoft.AspNetCore.Http.Abstractions (5)
src\aspnetcore\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\aspnetcore\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\aspnetcore\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\aspnetcore\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.NetAnalyzers (1)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Lightup\LightupHelpers.cs (1)
36Expression result = Expression.Call(instance, property.GetMethod!);
Microsoft.CodeAnalysis.Scripting (6)
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (3)
335members.AddRange(type.DeclaredProperties.Where(f => f.GetMethod != null && !f.GetMethod.IsStatic)); 384var getter = property.GetMethod;
Hosting\ObjectFormatter\ObjectFormatterHelpers.cs (3)
152var getter = property.GetMethod; 213var getter = ((PropertyInfo)member).GetMethod; 260if (property.GetMethod == null)
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.Extensions.AI.Abstractions (1)
Functions\AIFunctionFactory.cs (1)
1208private static readonly MethodInfo _taskGetResult = typeof(Task<>).GetProperty(nameof(Task<int>.Result), BindingFlags.Instance | BindingFlags.Public)!.GetMethod!;
Microsoft.Extensions.AI.Abstractions.Tests (1)
Functions\DelegatingAIFunctionTests.cs (1)
54case PropertyInfo propertyInfo when propertyInfo.GetMethod?.IsVirtual is true:
Microsoft.Extensions.Configuration.Binder (8)
ConfigurationBinder.cs (8)
279if (property.GetMethod is null || 281(!options.BindNonPublicProperties && (!property.GetMethod.IsPublic || !property.SetMethod.IsPublic)) || 282property.GetMethod.GetParameters().Length > 0) 295if (property.GetMethod == null || 296(!options.BindNonPublicProperties && !property.GetMethod.IsPublic) || 297property.GetMethod.GetParameters().Length > 0) 715object? k = keyMethod.GetMethod!.Invoke(item, null); 716object? 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.Diagnostics.Testing (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\BindingExtensions.g.cs (1)
530MethodInfo? temp67 = instance.GetMethod;
Microsoft.Extensions.Options.DataAnnotations (4)
DataAnnotationValidateOptions.Async.cs (2)
114if (propertyInfo.GetMethod is null || propertyInfo.GetMethod.GetParameters().Length > 0)
DataAnnotationValidateOptions.cs (2)
106if (propertyInfo.GetMethod is null || propertyInfo.GetMethod.GetParameters().Length > 0)
Microsoft.Extensions.VectorData.Abstractions (1)
ProviderServices\Filter\FilterTranslatorBase.cs (1)
316case PropertyInfo { GetMethod.IsStatic: false } propertyInfo when baseValue is null:
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>());
System.ComponentModel.Annotations (4)
System\ComponentModel\DataAnnotations\LocalizableString.cs (1)
141var getter = property.GetMethod;
System\ComponentModel\DataAnnotations\ValidationAttribute.cs (1)
278var 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)
782else if (propertyInfo.GetMethod?.IsStatic == true || propertyInfo.SetMethod?.IsStatic == true) 837_propertyFetch = (Func<TObject, TProperty>)property.GetMethod!.CreateDelegate(typeof(Func<TObject, TProperty>)); 856_propertyFetch = (StructFunc<TStruct, TProperty>)property.GetMethod!.CreateDelegate(typeof(StructFunc<TStruct, TProperty>)); 878_getterInvoker = MethodInvoker.Create(property.GetMethod!); 1018if (property.GetMethod == null || property.GetMethod!.GetParameters().Length > 0)
System.Private.CoreLib (4)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\PropertyValue.cs (2)
228return property.GetMethod!.CreateDelegate(typeof(Func<,>).MakeGenericType(property.DeclaringType!, propertyType)); 235property.GetMethod!.CreateDelegate<Func<TContainer, TProperty>>();
System\Reflection\Runtime\BindingFlagSupport\PropertyPolicies.cs (2)
94MethodInfo? accessor = property.GetMethod; 105MethodInfo? getter = property.GetMethod;
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)
834MethodInfo? getMethod = property.GetMethod;
System\Runtime\Serialization\CodeGenerator.cs (2)
588MethodInfo? getMethod = property.GetMethod; 1247private static readonly MethodInfo s_stringLength = typeof(string).GetProperty("Length")!.GetMethod!;
System\Runtime\Serialization\DataMember.cs (1)
254MethodInfo? getMethod = property.GetMethod;
System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (2)
125s_getItemContractMethod = typeof(CollectionDataContract).GetProperty("ItemContract", Globals.ScanAllMembers)!.GetMethod; 629s_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)
1631if (memberInfo is PropertyInfo propInfo && propInfo.GetMethod == null) 1639if (mi is PropertyInfo pi && pi.GetMethod != null && pi.PropertyType == propInfo.PropertyType)
System\Xml\Serialization\Types.cs (4)
1271if (info.GetMethod != null && !info.GetMethod!.IsPublic 1273&& ((PropertyInfo)memberInfoToBeReplaced).GetMethod!.IsPublic 1420MethodInfo getMethod = defaultProp.GetMethod!;
System.Reflection.DispatchProxy (4)
System\Reflection\DispatchProxyGenerator.cs (4)
336var ai = new PropertyAccessorInfo(pi.GetMethod, pi.SetMethod); 337if (pi.GetMethod != null) 338propertyMap[pi.GetMethod] = ai; 386PropertyAccessorInfo ai = propertyMap[pi.GetMethod ?? pi.SetMethod!];
System.Reflection.Emit (2)
System\Reflection\Emit\ModuleBuilderImpl.cs (1)
278if (property.GetMethod is MethodBuilderImpl gMb)
System\Reflection\Emit\TypeBuilderImpl.cs (1)
981MethodInfo? getMethod = property.GetMethod;
System.Reflection.MetadataLoadContext (3)
System\Reflection\Runtime\BindingFlagSupport\PropertyPolicies.cs (2)
85property.GetMethod ?? property.SetMethod; 89MethodInfo? getter = property.GetMethod;
System\Reflection\TypeLoading\Properties\RoProperty.cs (1)
105public sealed override bool CanRead => GetMethod != null;
System.Text.Json (8)
src\runtime\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)
598if (propertyInfo.GetMethod?.IsPublic == true || 895MethodInfo? getMethod = propertyInfo.GetMethod;
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Union.cs (1)
422valueProperty.GetMethod is { IsPublic: true } &&
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (2)
417MethodInfo? realMethod = propertyInfo.GetMethod; 460MethodInfo? realMethod = propertyInfo.GetMethod;
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (2)
182MethodInfo getMethodInfo = propertyInfo.GetMethod!; 195MethodInfo getMethodInfo = propertyInfo.GetMethod!;
System.Text.Json.SourceGeneration (1)
Helpers\RoslynExtensions.cs (1)
854MethodInfo? getter = typeof(ITypeSymbol).GetProperty("IsClosed")?.GetMethod;