Skip to content

feat(commands): support Task<TResult> as async execute return type #56

Description

@Skymly

Summary

[DelegateCommand] / [AsyncDelegateCommand] currently reject execute methods that return Task<TResult> (documented in README and enforced in DelegateCommandGenerator).

Motivation

Some async APIs return Task<T> rather than non-generic Task or ValueTask<T>. Supporting this shape would reduce friction when wiring Prism commands.

Proposed direction

  • Define emission strategy (e.g. discard result vs. surface as command generic type).
  • Add diagnostics for unsupported combinations (similar to PSG1001 for CancellationToken + ValueTask).
  • Extend unit/snapshot tests and README/docs.

References

  • README: Task<TResult> is not supported for execute methods.
  • DelegateCommandGenerator.cs comment: unchanged since initial release.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions