Signum Documentation

The documentation comes from the Markdown files in the source code, so is always up-to-date but available only in English. Enjoy!

Paste your Framework commit SHA


Some extensions to enrich [Reflection API][]. See also ReflectionUtils.

Nullify, UnNullify and IsNullable

Extension methods over System.Type to deal with Nullable Types.

public static bool IsNullable(this Type type)
public static Type Nullify(this Type type)
public static Type UnNullify(this Type type)


Type intType = typeof(int);
Console.WriteLine(intType.IsNullable());  //false
Type nIntType = intType.Nullify();
Console.WriteLine(nIntType.IsNullable()); //true
Console.WriteLine(nIntType.UnNullify() == intType); //true


Gets the returning type for a PropertyInfo, FieldInfo, MethodInfo, ConstructorInfo or EventInfo in a... carefree way. Returns null for System.Type (i.e: nested Type).

public static Type ReturningType(this MemberInfo m)


MemberInfo member = typeof(Person).GetMember(DateTime.Today.Day % 2 == 0 ? "_name" : "Name");
//Returns string type, whether a FieldInfo or a PropertyInfo is retrieved.

HasAttribute and SigleAttribute

Allows to know easily if a MemeberInfo contains attributes of some type and retrieves them (if any).

public static bool HasAttribute<T>(this ICustomAttributeProvider mi) where T : Attribute
public static T SingleAttribute<T>(this ICustomAttributeProvider mi) where T : Attribute


public class Person


typeof(Person).HasAttribute<SerializableAttribute>(); //Returns true
typeof(Person).SingleAttribute<SerializableAttribute>(); //returns the SerializableAttribute


Fast way to know if a System.Type represents a 'concretization' of a generic type.

public static bool IsInstantiationOf(this Type type, Type genericType)


typeof(List<int>).IsInstantiationOf(typeof(List<>)); // returns true 

FieldEquals and PropertyEquals

Simple way to compare a FieldInfo (or PropertyInfo) using [Reflection|Strong Typed Reflection].

public static bool FieldEquals<T>(this FieldInfo fi, Expression<Func<T, object>> lambdaToFiel)
public static bool PropertyEquals<T>(this PropertyInfo fi, Expression<Func<T, object>> lambdaToProperty)


typeof(string).GetProperty("Length").PropertyEquals((string s) => s.Length); //returns true


Returns whether a property has no setter or it's not public.

public static bool IsReadOnly(this PropertyInfo pi)


typeof(string).GetProperty("Length").IsReadOnly(); //returns true