Ask a question
Hello,
If you have a create command without any return type the method is generated as async, however doesn't await or complete any task (as below)
public async Task Handle(CreateItemCommand request, CancellationToken cancellationToken)
{
var item= new Item
{
Id = request.Id,
Value = request.Value
};
_repository.Add(item);
}
Would it be possible to change methods like these to remove the async keyword, and return Task.CompletedTask ?
According to AI benchmarks its considerably quicker if we return a task.

Ask a question
Hello,
If you have a create command without any return type the method is generated as async, however doesn't await or complete any task (as below)
Would it be possible to change methods like these to remove the async keyword, and return Task.CompletedTask ?
According to AI benchmarks its considerably quicker if we return a task.