Skip to content

Instantly share code, notes, and snippets.

@rmaziarka
Last active April 8, 2018 12:26
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 rmaziarka/bda1abb4891b9394d45cbc60b9cc92fc to your computer and use it in GitHub Desktop.
Save rmaziarka/bda1abb4891b9394d45cbc60b9cc92fc to your computer and use it in GitHub Desktop.
Product Entities
public class Category
{
public int Id { get; set; }
public string Name { get; set; }
public List<Field> Fields { get; set; }
}
// Fields
public class Field
{
public int Id { get; set; }
public string Name { get; set; }
public int CategoryId { get; set; }
public Category Category { get; set; }
public IEnumerable<ValidationRule> ValidationRules { get; set; }
}
public class IntegerField : Field { }
public class StringField : Field { }
// etc.
// Field Values
public class FieldValue
{
public int FieldId { get; set; }
public Field Field { get; set; }
}
public class IntegerFieldValue : FieldValue
{
public int IntegerValue { get; set; }
}
public class StringFieldValue : FieldValue
{
public string StringValue { get; set; }
}
// etc.
public class Product
{
public int Id { get; set; }
public string Name { get; set; }
public int CategoryId { get; set; }
public Category Category { get; set; }
public List<FieldValue> FieldValues { get; set; }
public DateTime CreationDate { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment