Instantly share code, notes, and snippets.

Embed
What would you like to do?
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