Microsoft.Extensions.Options.DataAnnotations.Internal.Helpers
This namespace contains internal helper classes for the DataAnnotations integration with Microsoft.Extensions.Options.
Types
-
ObjectHelper
Provides helper methods for object manipulation, primarily for reflection-based operations within the options validation system.
View details
ObjectHelper
Summary
Provides helper methods for object manipulation, primarily for reflection-based operations within the options validation system.
namespace Microsoft.Extensions.Options.DataAnnotations.Internal.Helpers
Methods
-
public static bool GetPropertyValue<T>(object instance, string propertyName, out T& value)
Gets the value of a property from an object instance. -
public static bool IsCollection(object value)
Checks if the given value is a collection (e.g., array, List). -
public static IEnumerable GetCollection(object value)
Returns the collection if the value is a collection, otherwise null. -
public static bool IsDictionary(object value)
Checks if the given value is a dictionary (e.g., Dictionary, KeyValuePair). -
public static IDictionary GetDictionary(object value)
Returns the dictionary if the value is a dictionary, otherwise null.