Skip to content

Instantly share code, notes, and snippets.

@pielegacy
Created January 16, 2017 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pielegacy/acdaab5dd6566ac8307d6c3d3ec5ba31 to your computer and use it in GitHub Desktop.
Save pielegacy/acdaab5dd6566ac8307d6c3d3ec5ba31 to your computer and use it in GitHub Desktop.
That stupid tomato class from that article
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