BO4E/BoMapper.cs
/// <summary>
///     Get those fields of a business object that do have attributes/annotations.
///     The result is ordered by the JsonProperty->Order value (assuming 0 if null).
/// </summary>
/// <param name="boType">type of the business object</param>
/// <param name="attributeType">type of the attribute/annotation you're interested in
///     <example>typeof(DataCategoryAttribute)</example>
/// </param>
/// <returns>Array of FieldInfos</returns>
Get those fields of a business object that do have attributes/annotations.
The result is ordered by the JsonProperty->Order value (assuming 0 if null).
Get those fields of a business object that do have attributes / annotations . The result is ordered by the JsonProperty - > Order value ( assuming 0 if null ) .
[Obsolete("Fields are only private version 1.1", true)]
        public static FieldInfo[] GetAnnotatedFields(Type boType, Type attributeType)
        {
            return boType.GetFields()
                .Where(f => f.GetCustomAttributes(attributeType, false).Length > 0)
                .OrderBy(af => af.GetCustomAttribute<JsonPropertyAttribute>()?.Order)
                .ToArray();
        }
[ Obsolete ( " " , true ) ] public static FieldInfo [ ] GetAnnotatedFields ( Type boType , Type attributeType ) { return boType . GetFields ( ) . Where ( f => f . GetCustomAttributes ( attributeType , false ) . Length > 0 ) . OrderBy ( af => af . GetCustomAttribute < JsonPropertyAttribute > ( ) ? . Order ) . ToArray ( ) ; }
Get those fields of a business object that do have attributes/annotations.
Get those fields of a business object that do have attributes / annotations .
Array of FieldInfos
Array of FieldInfos
boType
Type
type of the business object
type of the business object
attributeType
Type
type of the attribute/annotation you're interested in
typeof(DataCategoryAttribute)
type of the attribute / annotation you ' re interested in typeof ( DataCategoryAttribute )