This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #251 from rinkudesu/ignore-http-when-filtering
Ignore "http(s)://" when filtering and sorting
- Loading branch information
Showing
14 changed files
with
310 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
Rinkudesu.Services.Links/Rinkudesu.Services.Links/DataTransferObjects/V1/LinkCreateDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Diagnostics.CodeAnalysis; | ||
using Rinkudesu.Services.Links.Models; | ||
|
||
namespace Rinkudesu.Services.Links.DataTransferObjects.V1 | ||
{ | ||
/// <summary> | ||
/// Data transfer object to send and receive <see cref="Link"/> objects | ||
/// </summary> | ||
[ExcludeFromCodeCoverage] | ||
public class LinkCreateDto | ||
{ | ||
/// <summary> | ||
/// URL the link is pointing to | ||
/// </summary> | ||
[DataType(DataType.Url)] | ||
[MaxLength(200)] | ||
[SuppressMessage("Design", "CA1056:URI-like properties should not be strings")] | ||
public string LinkUrl { get; set; } = null!; | ||
/// <summary> | ||
/// Title of the link | ||
/// </summary> | ||
[MaxLength(250)] | ||
public string Title { get; set; } = null!; | ||
/// <summary> | ||
/// Description of the link | ||
/// </summary> | ||
[MaxLength(1000)] | ||
public string? Description { get; set; } | ||
/// <summary> | ||
/// Privacy configuration of the link | ||
/// </summary> | ||
public Link.LinkPrivacyOptions PrivacyOptions { get; set; } | ||
|
||
/// <summary> | ||
/// Verifies whether <see cref="LinkUrl"/> is a valid absolute url. | ||
/// </summary> | ||
public bool IsLinkUrlValid() => Uri.TryCreate(LinkUrl, UriKind.Absolute, out _); | ||
} | ||
} |
Oops, something went wrong.