5 instantiations of PropertyHelper
Microsoft.AspNetCore.Shared.Tests (5)
PropertyHelperTest.cs (4)
22
var helper = new
PropertyHelper
(property);
37
var helper = new
PropertyHelper
(property);
52
var helper = new
PropertyHelper
(property);
100
var helper = new
PropertyHelper
(property);
src\Shared\PropertyHelper\PropertyHelper.cs (1)
532
propertyHelpers.Add(new
PropertyHelper
(property));
103 references to PropertyHelper
Microsoft.AspNetCore.Shared.Tests (103)
PropertyHelperTest.cs (80)
19
var property =
PropertyHelper
.GetProperties(anonymous.GetType()).First().Property;
22
var
helper = new PropertyHelper(property);
34
var property =
PropertyHelper
.GetProperties(anonymous.GetType()).First().Property;
37
var
helper = new PropertyHelper(property);
49
var property =
PropertyHelper
.GetProperties(anonymous.GetType()).First().Property;
52
var
helper = new PropertyHelper(property);
65
var
helper =
PropertyHelper
.GetProperties(
81
var
helper =
PropertyHelper
.GetProperties(
97
var property =
PropertyHelper
.GetProperties(anonymous.GetType()).First().Property;
100
var
helper = new PropertyHelper(property);
114
var helpers1 =
PropertyHelper
.GetProperties(anonymous.GetType().GetTypeInfo());
115
var helpers2 =
PropertyHelper
.GetProperties(anonymous.GetType().GetTypeInfo());
130
var
helper = Assert.Single(
PropertyHelper
.GetProperties(anonymous.GetType().GetTypeInfo()));
141
var
helper = Assert.Single(
PropertyHelper
.GetProperties(anonymous.GetType().GetTypeInfo()));
152
var
helper = Assert.Single(
PropertyHelper
.GetProperties(anonymous.GetType().GetTypeInfo()));
164
var
helper = Assert.Single(
PropertyHelper
.GetProperties(obj.GetType().GetTypeInfo()));
179
var
helper = Assert.Single(
PropertyHelper
.GetProperties(anonymous.GetType().GetTypeInfo()));
189
var properties =
PropertyHelper
.GetProperties(nullableType);
202
var properties =
PropertyHelper
.GetProperties(myType);
205
var
property = Assert.Single(properties);
219
var
helper1 = Assert.Single(
PropertyHelper
.GetProperties(anonymous.GetType().GetTypeInfo()).Where(prop => prop.Name == "IntProp"));
220
var
helper2 = Assert.Single(
PropertyHelper
.GetProperties(anonymous.GetType().GetTypeInfo()).Where(prop => prop.Name == "StringProp"));
232
var helpers =
PropertyHelper
.GetProperties(derived.GetType().GetTypeInfo()).ToArray();
238
var
propAHelper = Assert.Single(helpers.Where(h => h.Name == "PropA"));
239
var
propBHelper = Assert.Single(helpers.Where(h => h.Name == "PropB"));
252
var helpers =
PropertyHelper
.GetProperties(derived.GetType().GetTypeInfo()).ToArray();
258
var
propAHelper = Assert.Single(helpers.Where(h => h.Name == "PropA"));
259
var
propBHelper = Assert.Single(helpers.Where(h => h.Name == "PropB"));
272
var helpers =
PropertyHelper
.GetProperties(derived.GetType().GetTypeInfo()).ToArray();
278
var
propAHelper = Assert.Single(helpers.Where(h => h.Name == "PropA"));
279
var
propBHelper = Assert.Single(helpers.Where(h => h.Name == "PropB"));
292
var helpers =
PropertyHelper
.GetProperties(typeof(ICollection<string>));
308
var helpers =
PropertyHelper
.GetProperties(typeof(IDictionary<string, string>));
326
var result =
PropertyHelper
.GetProperties(type).ToArray();
342
var result =
PropertyHelper
.GetVisibleProperties(type).ToArray();
345
var
property = Assert.Single(result);
357
var result =
PropertyHelper
.GetVisibleProperties(type).ToArray();
374
var result =
PropertyHelper
.GetVisibleProperties(type).ToArray();
391
var result =
PropertyHelper
.GetVisibleProperties(type.GetTypeInfo()).ToArray();
394
var
property = Assert.Single(result);
406
var result =
PropertyHelper
.GetVisibleProperties(type.GetTypeInfo()).ToArray();
423
var result =
PropertyHelper
.GetVisibleProperties(type.GetTypeInfo()).ToArray();
441
var publicPropertySetter =
PropertyHelper
.MakeFastPropertySetter(publicProperty);
442
var protectedPropertySetter =
PropertyHelper
.MakeFastPropertySetter(protectedProperty);
460
var propertySetter =
PropertyHelper
.MakeFastPropertySetter(property);
476
var propertySetter =
PropertyHelper
.MakeFastPropertySetter(property);
489
var
property =
PropertyHelper
493
var accessor =
PropertyHelper
.MakeFastPropertyGetter(property.Property);
503
var
property =
PropertyHelper
507
var accessor =
PropertyHelper
.MakeFastPropertyGetter(property.Property);
517
var
property =
PropertyHelper
521
var accessor =
PropertyHelper
.MakeNullSafeFastPropertyGetter(property.Property);
534
var
property =
PropertyHelper
538
var accessor =
PropertyHelper
.MakeNullSafeFastPropertyGetter(property.Property);
551
var
property =
PropertyHelper
555
var accessor =
PropertyHelper
.MakeNullSafeFastPropertyGetter(property.Property);
568
var
property =
PropertyHelper
572
var accessor =
PropertyHelper
.MakeNullSafeFastPropertyGetter(property.Property);
621
var result =
PropertyHelper
.ObjectToDictionary(testObject);
635
var dictValues =
PropertyHelper
.ObjectToDictionary(value);
649
var dictValues =
PropertyHelper
.ObjectToDictionary(value);
663
var dictValues =
PropertyHelper
.ObjectToDictionary(value);
678
var dictValues =
PropertyHelper
.ObjectToDictionary(value);
694
var dictValues =
PropertyHelper
.ObjectToDictionary(value);
710
var dictValues =
PropertyHelper
.ObjectToDictionary(value);
src\Shared\PropertyActivator\PropertyActivator.cs (1)
23
_fastPropertySetter =
PropertyHelper
.MakeFastPropertySetter(propertyInfo);
src\Shared\PropertyHelper\PropertyHelper.cs (22)
13
[assembly: MetadataUpdateHandler(typeof(Microsoft.Extensions.Internal.
PropertyHelper
.MetadataUpdateHandler))]
26
typeof(
PropertyHelper
).GetMethod(nameof(CallPropertyGetter), DeclaredOnlyLookup)!;
29
typeof(
PropertyHelper
).GetMethod(nameof(CallPropertyGetterByReference), DeclaredOnlyLookup)!;
32
typeof(
PropertyHelper
).GetMethod(nameof(CallNullSafePropertyGetter), DeclaredOnlyLookup)!;
35
typeof(
PropertyHelper
).GetMethod(nameof(CallNullSafePropertyGetterByReference), DeclaredOnlyLookup)!;
38
typeof(
PropertyHelper
).GetMethod(nameof(CallPropertySetter), DeclaredOnlyLookup)!;
41
private static readonly ConcurrentDictionary<Type,
PropertyHelper
[]> PropertiesCache = new();
43
private static readonly ConcurrentDictionary<Type,
PropertyHelper
[]> VisiblePropertiesCache = new();
49
/// Initializes a fast <see cref="
PropertyHelper
"/>.
122
public static
PropertyHelper
[] GetProperties(
143
public static
PropertyHelper
[] GetVisibleProperties(
333
foreach (
var
helper in GetProperties(value.GetType(), PropertiesCache))
411
public static
PropertyHelper
[] GetVisibleProperties(
413
ConcurrentDictionary<Type,
PropertyHelper
[]>? allPropertiesCache,
414
ConcurrentDictionary<Type,
PropertyHelper
[]>? visiblePropertiesCache)
424
foreach (
var
propertyHelper in allProperties)
441
var filteredProperties = new List<
PropertyHelper
>(allProperties.Length);
442
foreach (
var
propertyHelper in allProperties)
492
public static
PropertyHelper
[] GetProperties(
494
ConcurrentDictionary<Type,
PropertyHelper
[]>? cache)
502
var propertyHelpers = new List<
PropertyHelper
>();
522
List<
PropertyHelper
> propertyHelpers,