C# Class UtilJsonApiSerializer.Conventions.Impl.DefaultPropertyScanningConvention

Inheritance: IPropertyScanningConvention
Show file Open project: FrontlineEducation/Util-JsonApiSerializer Class Usage Examples

Public Methods

Method Description
DefaultPropertyScanningConvention ( ) : System
GetPropertyName ( PropertyInfo pi ) : string

Gets the name of the property as it gets serialized in JSON.

IsLinkedResource ( PropertyInfo pi ) : bool

Used to distinguish simple properties (serialized in-line) from linked resources (side-loaded in "linked" section).

IsPrimaryId ( PropertyInfo propertyInfo ) : bool

Determines if the given PropertyInfo is the primary ID of the currently scanned resource.

ShouldIgnore ( PropertyInfo pi ) : bool

Determines if the property should be ignored during scanning.

Private Methods

Method Description
IsMarkedSerializeAsPrimitive ( PropertyInfo pi ) : bool

Looks for "SerializeAsPrimitive" using reflection, with the idea being that such an attribute may be re-defined in projects that don't reference this one

Method Details

DefaultPropertyScanningConvention() public method

public DefaultPropertyScanningConvention ( ) : System
return System

GetPropertyName() public method

Gets the name of the property as it gets serialized in JSON.
public GetPropertyName ( PropertyInfo pi ) : string
pi System.Reflection.PropertyInfo
return string

IsLinkedResource() public method

Used to distinguish simple properties (serialized in-line) from linked resources (side-loaded in "linked" section).
public IsLinkedResource ( PropertyInfo pi ) : bool
pi System.Reflection.PropertyInfo
return bool

IsPrimaryId() public method

Determines if the given PropertyInfo is the primary ID of the currently scanned resource.
public IsPrimaryId ( PropertyInfo propertyInfo ) : bool
propertyInfo System.Reflection.PropertyInfo
return bool

ShouldIgnore() public method

Determines if the property should be ignored during scanning.
public ShouldIgnore ( PropertyInfo pi ) : bool
pi System.Reflection.PropertyInfo
return bool