public static Nullability GetTypeNullability(this ParameterDefinition parameter, MethodDefinition method)
        {
            if (parameter.ParameterType.FullName == "System.Void")
            {
                return(Nullability.NotNull);
            }

            // Look for explicit annotation on parameter
            var metadata = NullableMetadata.FromAttributeCollection(parameter.CustomAttributes);

            if (metadata != null)
            {
                return((Nullability)metadata.Data [0]);
            }

            // Default nullability status for method
            var nullable = GetNullableContext(method.CustomAttributes);

            if (nullable != Nullability.Oblivous)
            {
                return(nullable);
            }

            // Default nullability status for type
            return(GetNullableContext(method.DeclaringType.CustomAttributes));
        }
        public static Nullability GetTypeNullability(this FieldDefinition field)
        {
            if (field.FieldType.FullName == "System.Void")
            {
                return(Nullability.NotNull);
            }

            // Look for explicit annotation on field
            var metadata = NullableMetadata.FromAttributeCollection(field.CustomAttributes);

            if (metadata != null)
            {
                return((Nullability)metadata.Data [0]);
            }

            // Default nullability status for type
            return(GetNullableContext(field.DeclaringType.CustomAttributes));
        }