Last active
November 11, 2023 19:46
-
-
Save nanotaboada/4054009 to your computer and use it in GitHub Desktop.
A Plain Old CLR Object (POCO) model of a Book with DataAnnotations for validation
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
using System; | |
using System.ComponentModel.DataAnnotations; | |
namespace NanoTaboada.GitHub.Gist | |
{ | |
public class Book | |
{ | |
[Key] | |
public string Isbn { get; set; } | |
[Required] | |
public string Title { get; set; } | |
public string SubTitle { get; set; } | |
[Required] | |
public string Author { get; set; } | |
public string Publisher { get; set; } | |
[Required] | |
public DateTime Published { get; set; } | |
public int Pages { get; set; } | |
[Required] | |
public string Description { get; set; } | |
[Required] | |
[Url] | |
public string Website { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment