BO4E/meta/MultiLangResolver.cs
/// <summary>
///     Check every field for having translated name or no
/// </summary>
/// <param name="member"></param>
/// <param name="memberSerialization"></param>
/// <returns></returns>
Check every field for having translated name or no
Check every field for having translated name or no
protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
        {
            var prop = base.CreateProperty(member, memberSerialization);
            var att = prop.AttributeProvider.GetAttributes(true)
                .OfType<FieldName>()
                .FirstOrDefault(a => a.Language == _language);
            if (att != null) prop.PropertyName = att.Text;
            return prop;
        }
protected override JsonProperty CreateProperty ( MemberInfo member , MemberSerialization memberSerialization ) { var prop = base . CreateProperty ( member , memberSerialization ) ; var att = prop . AttributeProvider . GetAttributes ( true ) . OfType < FieldName > ( ) . FirstOrDefault ( a => a . Language == _language ) ; if ( att != null ) prop . PropertyName = att . Text ; return prop ; }
Check every field for having translated name or no
Check every field for having translated name or no
// See if there is a [FieldName] attribute applied to the property  // for the requested language // if so, change the property name to the one from the attribute
None
member
MemberInfo
None
memberSerialization
MemberSerialization
None