dapr / dapr/dotnet-sdk

Add nullability annotations to DaprClient

Open
#523 6 comments 2 reactions 0 assignees View on GitHub
kind/enhancement
Dominant language
C#
Stars
1.2k
Forks
378
Avg merge
2d 1h
Merged PRs (30d)
6

Description

## Describe the proposal

Once we ingest the .NET 5.0 SDK we we'll be able to add nullability annotations to most of the methods on `DaprClient`. The reason we didn't do this because is because prior to the C#9 compiler, a core use case didn't work with nullability:

```C#
public Task DoSomething();
```

There is no supported way (pre C# 9) to say *this method returns a task that might return a null* without also constraining `TValue : class`. We didn't want to block the use of value types at a fundamental level especially when records and structs are about to hit.

Now that this barrier has been removed there will be a benefit to adding NNRT annotations.

Contributor guide

Open the contributing guide

Research direction

Start by locating DaprClient in the .NET 5.0 SDK and reviewing its public methods alongside the project’s compiler and nullability settings. Done means the applicable DaprClient methods have nullability annotations while preserving support for value types; the issue names no specific files or tests to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.