Last active
August 18, 2019 21:13
-
-
Save lssweatherhead/194542ef0cbb29023054e7aebdcc1651 to your computer and use it in GitHub Desktop.
Code excerpts from Umbraco GraphQL Custom Data Sections
This file contains 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
[TableName("ItemTypes")] | |
[PrimaryKey("Id", autoIncrement = true)] | |
[ExplicitColumns] | |
public class ItemType | |
{ | |
[Column("Id")] | |
[PrimaryKeyColumn(AutoIncrement = true)] | |
public int Id { get; set; } | |
[Column("Name")] | |
public string Name { get; set; } | |
} | |
[TableName("Items")] | |
[PrimaryKey("Id", autoIncrement = true)] | |
[ExplicitColumns] | |
public class Item | |
{ | |
[Column("Id")] | |
[PrimaryKeyColumn(AutoIncrement = true)] | |
public int Id { get; set; } | |
[Column("ItemName")] | |
public string ItemName { get; set; } | |
[Column("ItemType")] | |
[ForeignKey(typeof(ItemType), Name = "FK_Item_TypeId")] | |
public int ItemType { get; set; } | |
[Column("MinCO2eGrams")] | |
public double MinCarbonDioxideEquivalent { get; set; } | |
[Column("MaxCO2eGrams")] | |
[NullSetting(NullSetting = NullSettings.Null)] | |
public double MaxCarbonDioxideEquivalent { get; set; } | |
} | |
[TableName("Variants")] | |
[PrimaryKey("Id", autoIncrement = true)] | |
[ExplicitColumns] | |
public class Variant | |
{ | |
[Column("Id")] | |
[PrimaryKeyColumn(AutoIncrement = true)] | |
public int Id { get; set; } | |
[Column("VariantName")] | |
public string VariantName { get; set; } | |
[Column("Item")] | |
[ForeignKey(typeof(Item), Name = "FK_Variant_ItemId")] | |
public int Item { get; set; } | |
[Column("CO2eGrams")] | |
public double CarbonDioxideEquivalent { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment