Last active
November 15, 2019 08:53
-
-
Save stijnmoreels/9d4ce491068fdd863e4fc63b32541171 to your computer and use it in GitHub Desktop.
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
public class BookJson | |
{ | |
[JsonConstructor] | |
public BookJson(string author, string isbn13, int pages) | |
{ | |
Author = Sanitize.RegexReplace(pattern: "( ){2,}", replacement: String.Empty, input: author).WhiteMatch(@"[a-zA-Z\. ]+"); | |
ISBN13 = Sanitize.RemoveWhitespace(isbn13).BlackList(@"\-"); | |
Pages = pages; | |
} | |
[JsonProperty("author")] | |
public string Author { get; } | |
[JsonProperty("isbn13")] | |
public string ISBN13 { get; } | |
[JsonProperty("pages")] | |
public int Pages { get; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment