Skip to content

Commit 0dc889d

Browse files
committed
Converted *Url fields to use the Uri type
This takes advantage of functionality introduced as part of #6d74fbf, which allows mapping of `Uri` types. It also allows more flexibility in views, as we can now parse parts of the URL if we prefer or need.
1 parent a1eb41a commit 0dc889d

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

OnTopic.ViewModels/ContentItemTopicViewModel.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
| Project Topics Library
55
\=============================================================================================================================*/
66

7+
using System;
8+
79
namespace OnTopic.ViewModels {
810

911
/*============================================================================================================================
@@ -33,15 +35,15 @@ public class ContentItemTopicViewModel: ItemTopicViewModel {
3335
/// <summary>
3436
/// Gets an optional URL for additional information that should be linked to.
3537
/// </summary>
36-
public string? LearnMoreUrl { get; set; }
38+
public Uri? LearnMoreUrl { get; set; }
3739

3840
/*==========================================================================================================================
3941
| THUMBNAIL IMAGE
4042
\-------------------------------------------------------------------------------------------------------------------------*/
4143
/// <summary>
4244
/// Gets an optional path to a thumbnail image that should accompany the content item.
4345
/// </summary>
44-
public string? ThumbnailImage { get; set; }
46+
public Uri? ThumbnailImage { get; set; }
4547

4648
/*==========================================================================================================================
4749
| CATEGORY

OnTopic.ViewModels/SectionTopicViewModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
| Project Topics Library
55
\=============================================================================================================================*/
66

7+
using System;
8+
79
namespace OnTopic.ViewModels {
810

911
/*============================================================================================================================
@@ -25,7 +27,7 @@ public class SectionTopicViewModel : TopicViewModel {
2527
/// <summary>
2628
/// Provides a header image which may be displayed at the top of a section.
2729
/// </summary>
28-
public string? HeaderImageUrl { get; set; }
30+
public Uri? HeaderImageUrl { get; set; }
2931

3032
} //Class
3133
} //Namespace

OnTopic.ViewModels/VideoTopicViewModel.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
| Project Topics Library
55
\=============================================================================================================================*/
66

7+
using System;
8+
79
namespace OnTopic.ViewModels {
810

911
/*============================================================================================================================
@@ -25,15 +27,15 @@ public class VideoTopicViewModel: PageTopicViewModel {
2527
/// <summary>
2628
/// Provides a URL reference to a video to display on the page.
2729
/// </summary>
28-
public string? VideoUrl { get; set; }
30+
public Uri? VideoUrl { get; set; }
2931

3032
/*==========================================================================================================================
3133
| POSTER URL
3234
\-------------------------------------------------------------------------------------------------------------------------*/
3335
/// <summary>
3436
/// Provides a URL reference to an image to display prior to playing the video.
3537
/// </summary>
36-
public string? PosterUrl { get; set; }
38+
public Uri? PosterUrl { get; set; }
3739

3840
} //Class
3941
} //Namespace

0 commit comments

Comments
 (0)