Core 1.4.0
v1.4.0 - 30 June 2026
- Add:
WithExecutePrivilege<T>(Privilege)on the Custom API builder for type-safe execute-privilege configuration, e.g..WithExecutePrivilege<Account>(Privilege.Read)resolves toprvReadaccount. AWithExecutePrivilege(string entityLogicalName, Privilege)overload is available for late-bound scenarios. The existingWithExecutePrivilegeName(string)remains for non-standard privilege names. - Add: Type-safe Custom API request/response wrappers.
RegisterAPI<TService>(name, handlerMethodName)now generates{ApiName}Request/{ApiName}Responseclasses (named after the API, in the plugin's namespace) from theAddRequestParameter/AddResponsePropertydeclarations. The handler accepts the request and returns the response; a generatedActionWrappermarshalsInputParametersinto the request and the returned response intoOutputParameters. When no request parameters are declared the handler takes no argument, and when no response properties are declared it returnsvoid. - Add: Error XPC4004: Custom API handler method not found (with code fix to create the method).
- Add: Warning XPC4005 / Error XPC4006: Custom API handler signature does not match the declared request parameters and response properties (with code fix to correct the signature).
- Add: XPC3001 (Prefer
nameofover string literal) now also covers the Custom API handler argument. - Add: Warning XPC3006: the typed
RegisterAPI<TService>(name, handlerMethodName)overload requires a compile-time constant name (so the generated classes can be named after the API); a non-constant name is reported instead of silently skipping generation. - Add: The typed
RegisterAPI<TService>(name, handlerMethodName)overload now throwsArgumentExceptionwhen the name or handler method name is null or whitespace, so misconfigurations fail fast at registration instead of being silently treated as "no registration" at execution time. - Fix: Generated image properties now mirror the
[Obsolete]attribute of the underlying entity property, so deprecation warnings (CS0612/CS0618) surface in the calling code instead of inside the auto-generated image class. - Fix: Generated code (images and Custom API request/response) now only emits nullable reference-type annotations (
string?) and a#nullable enabledirective when the consuming project has nullable reference types enabled. On projects without NRT (including .NET Framework / C# 7.3 defaults) the generated code is emitted without those annotations, keeping it compilable and warning-free. Nullable value types (int?) are always emitted.
What's Changed
- Mirror [Obsolete] onto generated image properties by @mkholt in #15
- Add type-safe Custom API request/response wrappers by @mkholt in #16
- Add type-safe execute privilege helpers for Custom APIs by @mkholt in #17
Full Changelog: v1.3.0/v1.1.0...v1.4.0/v1.1.0