question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add nullability annotations to DaprClient

See original GitHub issue

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:

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:open
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
philliphoffcommented, Mar 23, 2023

@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.

0reactions
dlemstracommented, Mar 20, 2021

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found