public static string?GetFlatBufferMetadataOrNull( this MemberInfo memberInfo, FlatBufferMetadataKind kind) { return(memberInfo .GetCustomAttributes <FlatBufferMetadataAttribute>() .Where(x => x.Kind == kind) .FirstOrDefault()? .Value); }
/// <summary> /// Initializes a new FlatBufferItemAttribute. /// </summary> /// <param name="index">The field index within the struct or table.</param> public FlatBufferMetadataAttribute(FlatBufferMetadataKind kind, string value) { this.Kind = kind; this.Value = value; }