Created
January 16, 2017 06:53
-
-
Save pielegacy/acdaab5dd6566ac8307d6c3d3ec5ba31 to your computer and use it in GitHub Desktop.
That stupid tomato class from that article
This file contains hidden or 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 TomatoAPI | |
{ | |
public class Tomato | |
{ | |
[Key] | |
public int Id { get; set; } | |
[Required] | |
[MaxLength(20)] | |
public string Name { get; set; } | |
[DataType(DataType.PostalCode)] | |
public string OriginPostCode { get; set; } | |
public TasteRating Tastes { get; set; } | |
} | |
public enum TasteRating | |
{ | |
Terrible, | |
Eh, | |
Good, | |
Great, | |
Superb | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment