コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the SerializableMember class.
        /// </summary>
        /// <param name="member">The member to serialize.</param>
        private SerializableMember(MemberInfo member)
        {
            Debug.Assert(member != null, "member cannot be null!");
            Debug.Assert(!member.Has<IgnoreDataMemberAttribute>(), "member should be ignored!");

            this.Name = member.Name; // May be overwritten by DataMember below
            this.MemberName = member.Name;

            DataMemberAttribute dataMemberAttribute = member.GetCustomAttribute<DataMemberAttribute>(true);
            if (dataMemberAttribute != null)
            {
                if (!string.IsNullOrWhiteSpace(dataMemberAttribute.Name))
                {
                    this.Name = dataMemberAttribute.Name;
                }

                this.IsRequired = dataMemberAttribute.IsRequired;
                this.Order = dataMemberAttribute.Order;
            }

            DataMemberJsonConverterAttribute converter = member.GetCustomAttribute<DataMemberJsonConverterAttribute>(true);
            if (converter != null && converter.ConverterType != null)
            {
                this.Converter = SerializableType.GetConverter(converter.ConverterType);
            }
        }
コード例 #2
0
ファイル: MemberData.cs プロジェクト: ReMinoer/Diese
        public MemberData(Type type, MemberInfo memberInfo)
        {
            Type = type;

            ServiceKey = memberInfo.GetCustomAttribute<ServiceKeyAttribute>()?.Key;
            InjectableAttribute = memberInfo.GetCustomAttribute<InjectableAttribute>();
        }
コード例 #3
0
 protected PropertyOrField(MemberInfo memberInfo)
 {
     MemberInfo = memberInfo;
     Base64Encoded = memberInfo.GetCustomAttribute<SerializeAsBase64Attribute>() != null;
     SerializeNull = memberInfo.GetCustomAttribute<SerializeNullAttribute>() != null;
     HasParameterAttribute = memberInfo.GetCustomAttribute<ParameterAttribute>() != null;
 }
コード例 #4
0
            public string GetName(MemberInfo member, bool includeProtocolProps = true)
            {
                Guard.ArgumentNotNull(member, "member");

                if (includeProtocolProps)
                {
                    var protocolAttr = member.GetCustomAttribute<SDataProtocolPropertyAttribute>();
                    if (protocolAttr != null)
                    {
                        var name = protocolAttr.Value != null ? protocolAttr.Value.ToString() : member.Name;
                        if (char.IsUpper(name[0]))
                        {
                            name = char.ToLowerInvariant(name[0]) + name.Substring(1);
                        }
                        return "$" + name;
                    }
                }

                #if !NET_2_0
                var contractAttr = member.GetCustomAttribute<DataContractAttribute>();
                if (contractAttr != null && !string.IsNullOrEmpty(contractAttr.Name))
                {
                    return contractAttr.Name;
                }

                var memberAttr = member.GetCustomAttribute<DataMemberAttribute>();
                if (memberAttr != null && !string.IsNullOrEmpty(memberAttr.Name))
                {
                    return memberAttr.Name;
                }
                #endif

                var elementAttr = member.GetCustomAttribute<XmlElementAttribute>();
                if (elementAttr != null && !string.IsNullOrEmpty(elementAttr.ElementName))
                {
                    return elementAttr.ElementName;
                }

                var attributeAttr = member.GetCustomAttribute<XmlAttributeAttribute>();
                if (attributeAttr != null && !string.IsNullOrEmpty(attributeAttr.AttributeName))
                {
                    return attributeAttr.AttributeName;
                }

                var arrayAttr = member.GetCustomAttribute<XmlArrayAttribute>();
                if (arrayAttr != null && !string.IsNullOrEmpty(arrayAttr.ElementName))
                {
                    return arrayAttr.ElementName;
                }

                var serviceAttr = member.GetCustomAttribute<SDataServiceOperationAttribute>();
                if (serviceAttr != null && !string.IsNullOrEmpty(serviceAttr.Name))
                {
                    return serviceAttr.Name;
                }

                return _transform(member.Name);
            }
コード例 #5
0
        public override string GetIndexFieldName(MemberInfo member)
        {
            var memberAttribute = GetIndexFieldNameFormatterAttribute(member);
            if (memberAttribute != null) return base.GetIndexFieldName(member);

            var fieldConfig = member.GetCustomAttribute<SitecoreFieldAttribute>(true);
            if (fieldConfig == null && member.DeclaringType != null)
            {
                var interfaceFromProperty = member.DeclaringType.GetInterfaces().FirstOrDefault(inter => inter.GetProperty(member.Name) != null);
                if (interfaceFromProperty != null)
                {
                    fieldConfig = interfaceFromProperty.GetMember(member.Name).First().GetCustomAttribute<SitecoreFieldAttribute>(true);
                }
            }

            if (fieldConfig != null && !string.IsNullOrEmpty(fieldConfig.FieldName))
                return base.GetIndexFieldName(fieldConfig.FieldName);

            if (fieldConfig == null)
            {
                var infoConfig = member.GetCustomAttribute<SitecoreInfoAttribute>(true);

                if (infoConfig == null && member.DeclaringType != null)
                {
                    var interfaceFromProperty = member.DeclaringType.GetInterfaces().FirstOrDefault(inter => inter.GetProperty(member.Name) != null);
                    if (interfaceFromProperty != null)
                    {
                        infoConfig = interfaceFromProperty.GetMember(member.Name).First().GetCustomAttribute<SitecoreInfoAttribute>(true);
                    }
                }

                if (infoConfig != null)
                {
                    switch (infoConfig.Type)
                    {
                        case SitecoreInfoType.DisplayName:
                            return base.GetIndexFieldName(BuiltinFields.DisplayName);
                        case SitecoreInfoType.FullPath:
                            return base.GetIndexFieldName(BuiltinFields.FullPath);
                        case SitecoreInfoType.TemplateId:
                            return base.GetIndexFieldName(BuiltinFields.Template);
                        case SitecoreInfoType.TemplateName:
                            return base.GetIndexFieldName(BuiltinFields.TemplateName);
                        case SitecoreInfoType.Url:
                            return base.GetIndexFieldName(BuiltinFields.Url);
                        case SitecoreInfoType.Version:
                            return base.GetIndexFieldName(BuiltinFields.Version);
                        case SitecoreInfoType.Name:
                            return base.GetIndexFieldName(BuiltinFields.Name);
                        case SitecoreInfoType.Language:
                            return base.GetIndexFieldName(BuiltinFields.Language);
                    }
                }
            }

            return base.GetIndexFieldName(member);
        }
コード例 #6
0
 private static void Process(MemberInfo member, ISpecification holder) {
     // give priority to Idempotent as more restrictive 
     if (member.GetCustomAttribute<IdempotentAttribute>() != null) {
         FacetUtils.AddFacet(new IdempotentFacet(holder));
     }
     else if (member.GetCustomAttribute<QueryOnlyAttribute>() != null) {
         FacetUtils.AddFacet(new QueryOnlyFacet(holder));
     }
 }
コード例 #7
0
ファイル: Metadata.cs プロジェクト: xiaokangz/MyQuery
        public static MetaColumn Create(MemberInfo member)
        {
            var databaseGeneratedAttr = member.GetCustomAttribute<DatabaseGeneratedAttribute>();

            return new MetaColumn
            {
                Member = member,
                ColumnName = GetColumnName(member),
                IsKey = member.GetCustomAttribute<KeyAttribute>() != null,
                IsIdentity = databaseGeneratedAttr != null && databaseGeneratedAttr.DatabaseGeneratedOption == DatabaseGeneratedOption.Identity,
                IsCompute = databaseGeneratedAttr != null && databaseGeneratedAttr.DatabaseGeneratedOption == DatabaseGeneratedOption.Computed,
            };
        }
コード例 #8
0
ファイル: Metadata.cs プロジェクト: xiaokangz/MyQuery
 private static string GetColumnName(MemberInfo member)
 {
     var columnAttr = member.GetCustomAttribute<ColumnAttribute>();
     return columnAttr != null && !string.IsNullOrWhiteSpace(columnAttr.Name)
                         ? columnAttr.Name
                         : member.Name;
 }
コード例 #9
0
		private static void UpdateDefaultValue(MemberInfo memberInfo, MetaProperty info)
		{
			var defaultAttribute = memberInfo.GetCustomAttribute<DefaultValueAttribute>();
			if (defaultAttribute == null) return;

			info.DefaultValue = defaultAttribute.Value;
		}
コード例 #10
0
 public static string GetCommandName(MemberInfo t)
 {
     var attr = t.GetCustomAttribute<CommandAttribute>();
     if (attr != null)
         return attr.Name;
     else return null;
 }
コード例 #11
0
ファイル: PrintHelper.cs プロジェクト: drwill/mash
        private static bool HasAttribute(MemberInfo mi, object o)
        {
            if (mi.DeclaringType.GetCustomAttribute<AppSettingAttribute>() != null)
            {
                return true;
            }

            return mi.GetCustomAttribute<AppSettingAttribute>() != null;
        }
コード例 #12
0
 private BrowserTypes GetExecutionBrowserMethodLevel(MemberInfo memberInfo)
 {
     var executionBrowserAttribute = memberInfo.GetCustomAttribute<ExecutionBrowserAttribute>(true);
     if (executionBrowserAttribute != null)
     {
         return executionBrowserAttribute.BrowserType;
     }
     return BrowserTypes.NotSet;
 }
コード例 #13
0
        public void SwaggerDtoPropertiesShouldHaveSwaggerPropertyAttribute(MemberInfo member)
        {
            var swaggerProperty = member.GetCustomAttribute<SwaggerPropertyAttribute>();
            if (swaggerProperty != null)
            {
                swaggerProperty.Name.ShouldNotBeNull();
                return;
            }

            var enumValue = member.GetCustomAttribute<SwaggerEnumValueAttribute>();
            if (enumValue != null)
            {
                enumValue.Value.ShouldNotBeNull();
                return;
            }

            throw new Exception(string.Format(
                "Member {0} is missing SwaggerProperty- or SwaggerEnumValueAttribute.", GetDisplayName(member)));
        }
コード例 #14
0
ファイル: Utilities.cs プロジェクト: hughbe/xml.net
        /// <summary>
        /// Gets the XML identifier of the member.
        /// </summary>
        /// <param name="memberInfo">The information about the member to use.</param>
        /// <returns>The XML identifier of the member.</returns>
        public static string GetIdentifier(MemberInfo memberInfo)
        {
            var nameAttribute = memberInfo.GetCustomAttribute<XmlConvertCustomElementAttribute>();
            if (nameAttribute != null)
            {
                return nameAttribute.Name;
            }

            return memberInfo.Name;
        }
コード例 #15
0
 // Note: this method is called just once for a given property; Newtonsoft serializer caches metadata information,
 // so the result is cached and reused. We are not concerned with efficiency here
 protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
 {
     var property = base.CreateProperty(member, memberSerialization);
       var nodeAttr = member.GetCustomAttribute<NodeAttribute>(inherit: true);
       if (nodeAttr != null)
     property.PropertyName = nodeAttr.Name;
       else if (ChangeToCamelCase)
     property.PropertyName = property.PropertyName.ToCamelCase();
       return property;
 }
コード例 #16
0
 private void ThrowExceptionIfOwnerAttributeNotSet(MemberInfo memberInfo)
 {
     try
     {
         memberInfo.GetCustomAttribute<OwnerAttribute>(true);
     }
     catch
     {
         throw new Exception("You have to set Owner of your test before you run it");
     }
 }
コード例 #17
0
		private static void UpdateSPFieldInfo(MemberInfo memberInfo, MetaProperty info)
		{
			var fieldAttribute = memberInfo.GetCustomAttribute<SpFieldAttribute>();
			if (fieldAttribute == null)
			{
				throw new ArgumentException(string.Format("Member {0} has no attribute SpFieldAttribute", memberInfo.Name), "memberInfo");
			}

			info.SpFieldInternalName = fieldAttribute.InternalName ?? info.MemberName;
			info.CustomConverterType = fieldAttribute.CustomConverterType;
		}
コード例 #18
0
        protected override JsonProperty CreateProperty (MemberInfo member, MemberSerialization memberSerialization)
        {
            JsonProperty property = base.CreateProperty(member, memberSerialization);

            // Skip serialization of empty collections.
            if ((property.DefaultValueHandling ?? DefaultValueHandling.Ignore).Has(DefaultValueHandling.Ignore) && IsPropertyCollection(property)) {
                Predicate<object> shouldSerialize = obj => {
                    var collection = property.ValueProvider.GetValue(obj) as ICollection;
                    return collection == null || collection.Count != 0;
                };
                property.ShouldSerialize = property.ShouldSerialize.Merge(shouldSerialize, (a, b) => a && b);
            }

            // Apply linked collection attributes.
            var linkedCollectionAttr = member.GetCustomAttribute<JsonLinkedCollectionAttribute>();
            var originCollectionAttr = linkedCollectionAttr as JsonOriginCollectionAttribute;
            if (originCollectionAttr != null && property.ItemConverter == null)
                property.ItemConverter = _originConverter;
            var linkCollectionAttr = linkedCollectionAttr as JsonLinkCollectionAttribute;
            if (linkCollectionAttr != null && property.ItemConverter == null)
                property.ItemConverter = _linkConverter;

            // Apply linked object attributes.
            var linkedAttr = member.GetCustomAttribute<JsonLinkedAttribute>();
            var originAttr = linkedAttr as JsonOriginAttribute;
            if (originAttr != null) {
                if (property.Converter == null)
                    property.Converter = _originConverter;
                if (property.MemberConverter == null)
                    property.MemberConverter = _originConverter;
            }
            var linkAttr = linkedAttr as JsonLinkAttribute;
            if (linkAttr != null) {
                if (property.Converter == null)
                    property.Converter = _linkConverter;
                if (property.MemberConverter == null)
                    property.MemberConverter = _linkConverter;
            }

            return property;
        }
コード例 #19
0
        /// <summary>
        /// Overrides this method to exclude properties with [Ignore] attribute or those that are in the given list.
        /// </summary>
        protected override JsonProperty CreateProperty( MemberInfo member, MemberSerialization memberSerialization )
        {
            var property = base.CreateProperty(member, memberSerialization);

             // Don't serialize properties that are decorated with [Ignore] or whose name are in the given list.
             if ( member.GetCustomAttribute(typeof(BaseVM.IgnoreAttribute)) != null )
            property.Ignored = true;
             else if ( _ignoredPropertyNames != null && _ignoredPropertyNames.Contains(property.PropertyName) )
            property.Ignored = true;

             return property;
        }
コード例 #20
0
ファイル: BuilderUpper.cs プロジェクト: modulexcite/Stylet
        private Expression ExpressionForMember(Expression objExpression, MemberInfo member, Type memberType, ParameterExpression registrationContext)
        {
            var attribute = member.GetCustomAttribute<InjectAttribute>(true);
            if (attribute == null)
                return null;

            var memberAccess = Expression.MakeMemberAccess(objExpression, member);
            var memberValue = this.parentContext.GetSingleRegistration(memberType, attribute.Key, true).GetInstanceExpression(registrationContext);
            var assign = Expression.Assign(memberAccess, memberValue);
            // Only actually do the assignment if the field/property is currently null
            return Expression.IfThen(Expression.Equal(memberAccess, Expression.Constant(null, memberType)), assign);
        }
コード例 #21
0
        public static bool IsSubcategoryOf(this SubCategory sub, Category cat)
        {
            Type t = typeof(SubCategory);

            System.Reflection.MemberInfo mi = t.GetMember(sub.ToString()).FirstOrDefault(m => m.GetCustomAttribute(typeof(SubcategoryOf)) != null);
            if (mi == null)
            {
                throw new ArgumentException("Subcategory " + sub + " has no category.");
            }
            SubcategoryOf subAttr = (SubcategoryOf)mi.GetCustomAttribute(typeof(SubcategoryOf));

            return(subAttr.Category == cat);
        }
コード例 #22
0
        protected override bool Validate(MemberInfo member)
        {
            if (member == null) {
                throw new ArgumentNullException();
            }
            if (!(member is Type)) {
                throw new ArgumentException("The given member is no class.");
            }

            if (member.GetCustomAttribute<JUUTTestClassAttribute>() != null) {
                return true;
            }
            throw new ArgumentException("The class " + member.Name + " doesn't have the JUUTTestClass-Attribute.");
        }
コード例 #23
0
        private void initByAttributes(MemberInfo mi)
        {
            DeserializerFactory = mi.GetCustomAttributes(false).OfType<IDeserializerFactory>().SingleOrDefault();

            var dmAttr = mi.GetCustomAttribute<DataMemberAttribute>();
            if (dmAttr == null)
                return;

            Required = dmAttr.IsRequired;
            if (string.IsNullOrWhiteSpace(dmAttr.Name))
                return;

            Name = dmAttr.Name;
        }
コード例 #24
0
ファイル: VisibilityLogic.cs プロジェクト: srndpty/VFW
        public static float GetMemberDisplayOrder(MemberInfo member)
        {
            var attribute = member.GetCustomAttribute<DisplayAttribute>();
            if (attribute != null && attribute.DisplayOrder.HasValue)
                return attribute.Order;

            switch (member.MemberType)
            {
                case MemberTypes.Field: return 100f;
                case MemberTypes.Property: return 200f;
                case MemberTypes.Method: return 300f;
                default: throw new NotSupportedException();
            }
        }
コード例 #25
0
        public static Operation CreateOperationObject(MemberInfo method)
        {
            Operation op = new Operation();

            OperationAttribute operationAttrib = method.GetCustomAttribute<OperationAttribute>();

            if (operationAttrib == null)
                throw new Exception(string.Format("The custom operation '{0}', doesn't contain the OperationAttribute.", method.Name));

            op.Verb = operationAttrib.Verb.ToString();
            op.Static = operationAttrib.Static;
            op.Path = operationAttrib.Path;
            op.Response = new Response();
            op.Response.ContentType = operationAttrib.ResponseContentType;
            op.Response.Type = operationAttrib.ResponseType;

            if (!string.IsNullOrEmpty(operationAttrib.ErrorResponseType))
            {
                op.ErrorResponse = new ErrorResponse();
                op.ErrorResponse.Type = operationAttrib.ErrorResponseType;
                if (!string.IsNullOrEmpty(operationAttrib.ErrorResponseProperties))
                {
                    string[] errorProperties = operationAttrib.ErrorResponseProperties.Split(';');
                    op.ErrorResponse.Properties = new Dictionary<string, string>();
                    foreach(string errorProperty in errorProperties)
                    {
                        if (!string.IsNullOrEmpty(errorProperty))
                        {
                            string[] splitProperty = errorProperty.Split(':');
                            if (splitProperty.Length == 2)
                                op.ErrorResponse.Properties.Add(splitProperty[0], splitProperty[1]);
                        }
                    }
                }
            }

            foreach(ParamAttribute paramAttribute in method.GetCustomAttributes<ParamAttribute>())
            {
                if (op.Parameters == null)
                    op.Parameters = new Dictionary<string, VSPlugin.Parameters>();
                op.Parameters.Add(paramAttribute.Name, new VSPlugin.Parameters()
                {
                    Kind = paramAttribute.Kind.ToStringAPS(),
                    Required = paramAttribute.Required,
                    Type = Utility.ConvertType2APSType(paramAttribute.Type)
                });
            }
            
            return op;
        }
コード例 #26
0
        private bool IsOptionalProperty(MemberInfo prop)
        {
            switch (Options.OptionalMemberGenerationMode)
            {
            case OptionalMemberGenerationMode.None:
                return(false);

            case OptionalMemberGenerationMode.UseDataMemberAttribute:
                var dataMemberAttribute = prop.GetCustomAttribute <DataMemberAttribute>(true);
                return(dataMemberAttribute != null && !dataMemberAttribute.IsRequired);

            default:
                throw new NotSupportedException($"Specified required member discovery option is not supported: {Options.OptionalMemberGenerationMode}.");
            }
        }
コード例 #27
0
ファイル: ClassSetUpAttribute.cs プロジェクト: LennartH/JUUT
        protected override bool Validate(MemberInfo member)
        {
            MethodInfo method = (MethodInfo) member;
            if (member.GetCustomAttribute<ClassSetUpAttribute>() != null) {
                if (!method.IsStatic) {
                    throw new ArgumentException("The method " + method.Name + " isn't static.");
                }
                if (method.GetParameters().Count() != 0) {
                    throw new ArgumentException("The method " + method.Name + " has parameters.");
                }

                return true;
            }
            return false;
        }
コード例 #28
0
		public MemberData(object source, MemberInfo member)
		{
			Source = source;
			Member = member;
			
			var valueConverterAttribute = member.GetCustomAttribute<ValueConverterAttribute>();
			if (valueConverterAttribute != null && !(valueConverterAttribute is CellViewTemplate))
			{
				ValueConverter = valueConverterAttribute.ValueConverter;
				ConverterParameter = valueConverterAttribute.ConverterParameter;
				ConverterParameterName = valueConverterAttribute.ConverterParameterPropertyName;
			}

			UpdateValue();
			Id = CreateId();
		}
コード例 #29
0
ファイル: ReflectionHelpers.cs プロジェクト: khbecker/FNA
 public static Attribute GetCustomAttribute(MemberInfo member, Type memberType)
 {
     if (member == null)
     {
         throw new NullReferenceException("Must supply the member parameter");
     }
     if (memberType == null)
     {
         throw new NullReferenceException("Must supply the memberType parameter");
     }
     #if WINRT
     return member.GetCustomAttribute(memberType);
     #else
     return Attribute.GetCustomAttribute(member, memberType);
     #endif
 }
コード例 #30
0
		/// <summary>
		/// Gets the name specified for use in Json serialization.
		/// </summary>
		/// <param name="value"></param>
		/// <returns></returns>
		public static string GetJsonSpecifiedProperty(MemberInfo memberInfo)
		{
#if NETFX_CORE
            if (memberInfo == null) return null;
            var attribute = memberInfo.GetCustomAttribute<JsonSpecifiedPropertyAttribute>(true);
            if (attribute == null)
            {
                return null;
            }
#else
            if (memberInfo == null ||
                            !Attribute.IsDefined(memberInfo, typeof(JsonSpecifiedPropertyAttribute)))
            {
                return null;
            }
            JsonSpecifiedPropertyAttribute attribute = (JsonSpecifiedPropertyAttribute)Attribute.GetCustomAttribute(memberInfo, typeof(JsonSpecifiedPropertyAttribute));
           
#endif
            return attribute.SpecifiedProperty;
		}
コード例 #31
0
        protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
        {
            var property =  base.CreateProperty(member, memberSerialization);

            var required = member.GetCustomAttribute(typeof(RequiredAttribute), inherit: true);
            if (required != null)
            {
                var propertyType = ((PropertyInfo)member).PropertyType;

                // DefaultObjectValidator does required attribute validation on properties based on the property
                // value being null. Since this is not possible in case of value types, we depend on the formatters
                // to handle value type validation.
                // With the following settings here, if a value is not present on the wire for value types
                // like primitive, struct etc., Json.net's serializer would throw exception which we catch
                // and add it to model state.
                if (propertyType.IsValueType() && !propertyType.IsNullableValueType())
                {
                    property.Required = Required.AllowNull;
                }
            }

            return property;
        }
コード例 #32
0
        private static bool ShouldDisplayMember(MemberInfo member, bool hasDataContractAttribute)
        {
            JsonIgnoreAttribute jsonIgnore = member.GetCustomAttribute<JsonIgnoreAttribute>();
            XmlIgnoreAttribute xmlIgnore = member.GetCustomAttribute<XmlIgnoreAttribute>();
            IgnoreDataMemberAttribute ignoreDataMember = member.GetCustomAttribute<IgnoreDataMemberAttribute>();
            NonSerializedAttribute nonSerialized = member.GetCustomAttribute<NonSerializedAttribute>();
            ApiExplorerSettingsAttribute apiExplorerSetting = member.GetCustomAttribute<ApiExplorerSettingsAttribute>();

            bool hasMemberAttribute = member.DeclaringType.IsEnum ?
                member.GetCustomAttribute<EnumMemberAttribute>() != null :
                member.GetCustomAttribute<DataMemberAttribute>() != null;

            // Display member only if all the followings are true:
            // no JsonIgnoreAttribute
            // no XmlIgnoreAttribute
            // no IgnoreDataMemberAttribute
            // no NonSerializedAttribute
            // no ApiExplorerSettingsAttribute with IgnoreApi set to true
            // no DataContractAttribute without DataMemberAttribute or EnumMemberAttribute
            return jsonIgnore == null &&
                xmlIgnore == null &&
                ignoreDataMember == null &&
                nonSerialized == null &&
                (apiExplorerSetting == null || !apiExplorerSetting.IgnoreApi) &&
                (!hasDataContractAttribute || hasMemberAttribute);
        }