public static ILSugar CastOrUnbox(this ILSugar il, Type type) { if (type == typeof(object)) { return(il); } if (type.IsValueType) { il.Unbox(type); } else { il.Castclass(type); } return(il); }