private static object ToDictionaryObject(this NSDictionary @this, Type targetType) { if (targetType != null && targetType.IsGenericType && targetType.GetGenericTypeDefinition() == typeof(Dictionary <,>)) { var types = targetType.GenericTypeArguments; return(@this.ToDictionary(types[0], types[1])); } else { return(@this.Cast(targetType)); } }
public static T Cast <T>(this NSDictionary @this, string documentId = null) { return((T)@this.Cast(typeof(T), documentId)); }