Last active
April 8, 2018 12:26
-
-
Save rmaziarka/bda1abb4891b9394d45cbc60b9cc92fc to your computer and use it in GitHub Desktop.
Product Entities
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
public class Category | |
{ | |
public int Id { get; set; } | |
public string Name { get; set; } | |
public List<Field> Fields { get; set; } | |
} |
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
// 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. |
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
// 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. |
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
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