Skip to content

Commit bfa64f1

Browse files
committed
Marked VideoUrl as non-nullable, required
This is similar to the updates made previously to core properties (1bf25be). `VideoUrl` is a core property of the `VideoTopicViewModel`, and always expected to have a value. If it doesn't, a validation error should be thrown.
1 parent 3b91ed8 commit bfa64f1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

OnTopic.ViewModels/_contentTypes/VideoTopicViewModel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
| Project Topics Library
55
\=============================================================================================================================*/
66
using System;
7+
using System.ComponentModel.DataAnnotations;
8+
using System.Diagnostics.CodeAnalysis;
79

810
namespace OnTopic.ViewModels {
911

@@ -26,6 +28,7 @@ public record VideoTopicViewModel: PageTopicViewModel {
2628
/// <summary>
2729
/// Provides a URL reference to a video to display on the page.
2830
/// </summary>
31+
[Required, NotNull, DisallowNull]
2932
public Uri? VideoUrl { get; init; }
3033

3134
/*==========================================================================================================================

0 commit comments

Comments
 (0)