AngleSharp by AngleSharp

<PackageReference Include="AngleSharp" Version="0.14.0" />

 ObjectExtensions

public static class ObjectExtensions
Some methods for working with bare objects.
public static IEnumerable<T> Concat<T>(this IEnumerable<T> items, T element)

Returns the concatenation of the provided enumerable with the specified element. The item is added to the beginning.

public static double Constraint(this double value, double min, double max)

Constraints the given value between the min and max values.

public static IEnumerable<T> Except<T>(this IEnumerable<T> items, T element)

Returns the removal of the specified element from the provided enumerable.

public static T GetItemByIndex<T>(this IEnumerable<T> items, int index)

Gets an item from the enumerable by its index. Throws an exception if the provided index is invalid.

public static string GetMessage<T>(this T code) where T : struct

Retrieves a string describing the error of a given error code.

public static U GetOrDefault<T, U>(this IDictionary<T, U> values, T key, U defaultValue)

Gets the value of the given key, otherwise the provided default value.

public static Dictionary<string, string> ToDictionary(this object values)

Transforms the values of the object into a dictionary of strings.

public static T? TryGet<T>(this IDictionary<string, object> values, string key) where T : struct

Tries to obtain the given key, otherwise returns the default value.

public static object TryGet(this IDictionary<string, object> values, string key)

Tries to obtain the given key, otherwise returns null.