Skip to content

Instantly share code, notes, and snippets.

@hudo
Created October 30, 2012 11:40
Show Gist options
  • Save hudo/3979750 to your computer and use it in GitHub Desktop.
Save hudo/3979750 to your computer and use it in GitHub Desktop.
webshop model
public class Product
{
public int ProductId { get; set; }
public int Name { get; set; }
public decimal Price { get; set; }
public virtual Category Category { get; set; }
}
public class Category
{
public int CategoryId { get; set; }
public string Title { get; set; }
public virtual ICollection<Product> Products { get; set; }
}
public class StoreContext : DbContext
{
public DbSet<Product> Products { get; set; }
public DbSet<Category> Categories { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment