Skip to content

Commit 044dfc7

Browse files
authored
Edit install-and-use-a-package-using-the-dotnet-cli.md -- remove source of warning (#3220)
The sample code ```csharp public class Account { public string Name { get; set; } public string Email { get; set; } ... } ``` leads to warnings: ``` $ dotnet run Nuget.Quickstart/Program.cs(7,23): warning CS8618: Non-nullable property 'Name' must contain a non-null value when exiting constructor. Consider declaring the property as nullable. [Nuget.Quickstart/Nuget.Quickstart.csproj] Nuget.Quickstart/Program.cs(8,23): warning CS8618: Non-nullable property 'Email' must contain a non-null value when exiting constructor. Consider declaring the property as nullable. [Nuget.Quickstart/Nuget.Quickstart.csproj] ``` This commit applies a small edit so that `dotnet run` does not warn. The warnings are not a big deal. They are a small distraction. I propose this edit in case the small distraction is worth removing.
1 parent bad8849 commit 044dfc7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/quickstart/install-and-use-a-package-using-the-dotnet-cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ You can install NuGet packages into a .NET project. For this walkthrough, create
6767
{
6868
public class Account
6969
{
70-
public string Name { get; set; }
71-
public string Email { get; set; }
70+
public string? Name { get; set; }
71+
public string? Email { get; set; }
7272
public DateTime DOB { get; set; }
7373
}
7474
internal class Program

0 commit comments

Comments
 (0)