ardalis / ardalis/BuilderTestSample

Would love to see this converted to use Nullable Reference Types

Open
#4 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
47
Forks
34
PR merge metrics
No merged PRs in 30d

Description

I am using nullable reference types on a Pulumi IaC project where I use the builder pattern. But find it difficult to get dotnet to figure out when items are not null.

The Builder Pattern is a delayed constructor.
The things it is supposed to build will be null until the `Build()` method has been executed.
But after `Build` they won't be null.

I try to help by using `MemberNotNull` attributes but that seems to just kick the can down the road only level.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting the builder implementation and its unit tests in BuilderTestSample; the issue provides no file paths. Trace the properties that remain null until Build() and the existing MemberNotNull annotations. Done means nullable reference types recognize those members as non-null after Build(), with the unit tests still passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
developer-experience
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.