Provides object extension methods.
InheritanceSystem.Object
Namespace: Umbraco.Extensions Assembly: Umbraco.Core.dll Syntaxpublic static class ObjectExtensions
Methods View Source AsEnumerableOfOne<T>(T) Declaration
public static IEnumerable<T> AsEnumerableOfOne<T>(this T input)
Parameters Type Name Description T input Returns Type Description System.Collections.IEnumerable<T> Type Parameters View Source AsGuid(Object) Declaration
public static Guid AsGuid(this object value)
Parameters Type Name Description System.Object value Returns View Source DisposeIfDisposable(Object)
Disposes the object if it implements .
Declarationpublic static void DisposeIfDisposable(this object input)
Parameters Type Name Description System.Object input
The object.
View Source SafeCast<T>(Object)Provides a shortcut way of safely casting an input when you cannot guarantee the T
is an instance type (i.e., when the C# AS keyword is not applicable).
public static T SafeCast<T>(this object input)
Parameters Type Name Description System.Object input
The input.
Returns Type Parameters View Source ToDictionary<TVal>(Object, String[])Turns object into dictionary
Declarationpublic static IDictionary<string, TVal> ToDictionary<TVal>(this object o, params string[] ignoreProperties)
Parameters Type Name Description System.Object o System.String[] ignoreProperties
Properties to ignore
Returns Type Description System.Collections.IDictionary<System.String, TVal> Type Parameters View Source ToDictionary<T, TProperty, TVal>(T, Expression<Func<T, TProperty>>[])Converts an object into a dictionary
Declarationpublic static IDictionary<string, TVal>? ToDictionary<T, TProperty, TVal>(this T o, params Expression<Func<T, TProperty>>[] ignoreProperties)
Parameters Type Name Description T o System.Linq.Expressions.Expression<Func<T, TProperty>>[] ignoreProperties Returns Type Description System.Nullable<System.Collections.IDictionary<System.String, TVal>> Type Parameters Name Description T TProperty TVal View Source ToXmlString(Object, Type)
Returns an XmlSerialized safe string representation for the value
Declarationpublic static string ToXmlString(this object value, Type type)
Parameters Type Name Description System.Object value Type type
The Type can only be a primitive type or Guid and byte[] otherwise an exception is thrown
Returns Type Description System.String View Source ToXmlString<T>(Object)Returns an XmlSerialized safe string representation for the value and type
Declarationpublic static string ToXmlString<T>(this object value)
Parameters Type Name Description System.Object value Returns Type Description System.String Type Parameters View Source TryConvertTo(Object, Type)
Attempts to convert the input object to the output type.
Declarationpublic static Attempt<object> TryConvertTo(this object input, Type target)
Parameters Type Name Description System.Object input
The input.
Type targetThe type to convert to
Returns View Source TryConvertTo<T>(Object)Attempts to convert the input object to the output type.
Declarationpublic static Attempt<T> TryConvertTo<T>(this object input)
Parameters Type Name Description System.Object input
The input.
Returns Type Parameters Name Description TThe type to convert to
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4