Skip to content

Commit 367d40e

Browse files
authored
Remove set accessors from the view model (#911)
The view model can be immutable. This matches the text description (and the intent).
1 parent cb93b70 commit 367d40e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

csharp/tutorials/nullable-reference-migration/finished/SimpleFeedReader/ViewModels/NewsStoryViewModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ public class NewsStoryViewModel
99
public NewsStoryViewModel(DateTimeOffset published, string title, string uri) =>
1010
(Published, Title, Uri) = (published, title, uri);
1111

12-
public DateTimeOffset Published { get; set; }
13-
public string Title { get; set; }
14-
public string Uri { get; set; }
12+
public DateTimeOffset Published { get; }
13+
public string Title { get; }
14+
public string Uri { get; }
1515
}
1616
#nullable restore
1717
// </SnippetFinishedViewModel>

0 commit comments

Comments
 (0)