Skip to content

Return reference from interaction service methods #13015

@JamesNK

Description

@JamesNK

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

IInteractionService methods like PromptInputsAsync return a task that is completed with the result. There maybe scenarios where it's useful to have a reference to the interaction prompt before the result is returned.

Describe the solution you'd like

Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(...) could be changed to Interaction<InteractionInputCollection> PromptInputs(...)

And Interaction<TResult> looks like this:

public sealed class Interaction<TResult>
{
    public Task<InteractionResult<TResult>> GetResultAsync()
    public void Cancel() 
    public TaskAwaiter<TResponse> GetAwaiter()
    public ConfiguredTaskAwaitable<TResponse> ConfigureAwait(bool continueOnCapturedContext)
}

Other methods would follow a similar pattern.

Additional context

No response

Metadata

Metadata

Assignees

Labels

area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions