-
Notifications
You must be signed in to change notification settings - Fork 3
Polyfills
COMET is the new name for what was previously called the CDP4. We are transitioning the applications and software libraries. The code and documentation will still refer to CDP4 in a number of places while we are updating.
The COMET-SDK provides support for the following target frameworks:
- net45
- net451
- net452
- net46
- net461
- net462
- net47
- netstandard1.6
- netstandard2.0
The Type
class does not expose the same API in the different target frameworks. A polyfill class is made available to provide exentions methods on the Type
class to harmonize the implementation for all the target frameworks of the COMET-SDK.
Methods and properties that are not available using the same .NET libraries or namespaces for all the target frameworks are prefixed with the word Query
. These methods are implemented in the same file. Compiler directives are used to differentiate between the implementations that are valid for the different target frameworks specified above.
An example:
NET45
public static bool QueryIsValueType(this Type type)
{
return type.IsValueType;
}
NETSTANDARD1.6
public static bool QueryIsValueType(this Type type)
{
return type.GetTypeInfo().IsValueType;
}
kudos to Michael Whelan for an excellent article on porting code to .NET Core.
« CDP4Common-CE Comparers — Documentation overview — CDP4Common-CE Validation »
copyright @ Starion Group S.A.