Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. [Table("Product")]
  2. public class Product : EntityBase
  3. {
  4. [Key]
  5. public int Id { get; set; }
  6.  
  7. public virtual ICollection<Argument> Arguments { get; set; }
  8. public virtual ICollection<Product> AdditionalProducts { get; set; }
  9. }
  10.  
  11. public partial class test1 : DbMigration
  12. {
  13. public override void Up()
  14. {
  15. AddColumn("dbo.Product", "Product_Id", c => c.Int());
  16. CreateIndex("dbo.Product", "Product_Id");
  17. AddForeignKey("dbo.Product", "Product_Id", "dbo.Product", "Id");
  18. }
  19.  
  20. public override void Down()
  21. {
  22. DropForeignKey("dbo.Product", "Product_Id", "dbo.Product");
  23. DropIndex("dbo.Product", new[] { "Product_Id" });
  24. DropColumn("dbo.Product", "Product_Id");
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement