BO4E/BoMapper.cs
/// <summary>
///     Get JSON Scheme for given Business Object type
/// </summary>
/// <param name="businessObjectType">Business Object type (e.g. typeof(BO4E.BO.Messlokation)</param>
/// <returns>A JSON scheme to be used for validation purposes.</returns>
/// <exception cref="ArgumentException">if given type is not derived from BusinessObject</exception>
/// <seealso cref="GetJsonSchemeFor(string)" />
Get JSON Scheme for given Business Object type
Get JSON Scheme for given Business Object type
public static JSchema GetJsonSchemeFor(Type businessObjectType)
        {
            if (!businessObjectType.IsSubclassOf(typeof(BusinessObject)))
                throw new ArgumentException($"The given type {businessObjectType} is not derived from BusinessObject.");
            var bo = Activator.CreateInstance(businessObjectType) as BusinessObject;
            return bo.GetJsonScheme();
        }
public static JSchema GetJsonSchemeFor ( Type businessObjectType ) { if ( ! businessObjectType . IsSubclassOf ( typeof ( BusinessObject ) ) ) throw new ArgumentException ( $" The given type  { businessObjectType }  is not derived from BusinessObject. " ) ; var bo = Activator . CreateInstance ( businessObjectType ) as BusinessObject ; return bo . GetJsonScheme ( ) ; }
Get JSON Scheme for given Business Object type
Get JSON Scheme for given Business Object type
A JSON scheme to be used for validation purposes.
A JSON scheme to be used for validation purposes .
if given type is not derived from BusinessObject
if given type is not derived from BusinessObject
businessObjectType
Type
Business Object type
Business Object type
seealso
None