Add nullability annotations to DaprClient
See original GitHub issueDescribe 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:
public Task<TValue> DoSomething<TValue>();
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.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
2
Tried to enable nullable in the DaprClient but I ran into a strange bug. ... Add nullability annotations to DaprClient · Issue #523...
Read more >Importing Dapr's Java SDK
For a Maven project, add the following to your pom.xml file: <project> ... <dependencies> ... <! ... BulkSubscribeAppResponse; import io.dapr.client.domain.
Read more >How-To: Invoke services using HTTP | Dapr Docs
This article demonstrates how to deploy services each with an unique application ID for other services to discover and call endpoints on them...
Read more >Nullability annotations - dotnet/runtime
Nullability annotations are about codifying a contract, and documentation is a description of that contract. If, for example, a base abstract or virtual...
Read more >Implementing Dapr Pub/Sub functionality to ASP.NET Core ...
Publisher Program.cs file, we need to add the DaprClient service to our service container like so: var builder = WebApplication.CreateBuilder( ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@halspang Do you think there’s any interest in this still? I just ran into a bug in my own application as a result of a wayward
null
that would have been caught with proper annotations.The
where T : default
solution seemed to work @rynowak. I also created the first PR for this with one of the small libraries. Can you clarify what you mean with the bindings?