CommunityToolkit / CommunityToolkit/dotnet

Setting the default value for the parameter of ExecuteAsync(object? parameter) to equal null

Open
#1,099 0 comments 0 reactions 0 assignees View on GitHub
feature request :mailbox_with_mail:
Dominant language
C#
Stars
3.8k
Forks
400
PR merge metrics
No merged PRs in 30d

Description

### Overview

to set the parameter default value to null

````csharp
Task ExecuteAsync(object? parameter);
````
to not require setting null if there is no parameters

### API breakdown

````csharp
Task ExecuteAsync(object? parameter == null);
````

### Usage example

instead of setting null
````csharp
SaveCommand.ExecuteAsync(null);
````
you can use it like
````csharp
SaveCommand.ExecuteAsync();
````

### Breaking change?

I'm not sure

### Alternatives

you show set null if there is no parameters
````csharp
SaveCommand.ExecuteAsync(null);
````

### Additional context

_No response_

### Help us help you

Yes, but only if others can assist

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.