AzureLens.Areas.HelpPage.ModelDescriptions.ModelDescriptionGenerator.GetMemberName C# (CSharp) 메소드

GetMemberName() 개인적인 정적인 메소드

private static GetMemberName ( MemberInfo member, bool hasDataContractAttribute ) : string
member System.Reflection.MemberInfo
hasDataContractAttribute bool
리턴 string
        private static string GetMemberName(MemberInfo member, bool hasDataContractAttribute)
        {
            JsonPropertyAttribute jsonProperty = member.GetCustomAttribute<JsonPropertyAttribute>();
            if (jsonProperty != null && !String.IsNullOrEmpty(jsonProperty.PropertyName))
            {
                return jsonProperty.PropertyName;
            }

            if (hasDataContractAttribute)
            {
                DataMemberAttribute dataMember = member.GetCustomAttribute<DataMemberAttribute>();
                if (dataMember != null && !String.IsNullOrEmpty(dataMember.Name))
                {
                    return dataMember.Name;
                }
            }

            return member.Name;
        }