Advertisement
Guest User

SeedMethod in Configuration.cs

a guest
Apr 27th, 2016
821
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.63 KB | None | 0 0
  1. //User tempUser = context.Users.Where(x => x.UserId == 1).FirstOrDefault();
  2. //User tempUser2 = context.Users.Where(x => x.UserName == "oskar").FirstOrDefault();
  3. //User tempUser3 = context.Users.Where(x => x.UserName == "nitinanand").FirstOrDefault();
  4.  
  5. //User tempUser = new User { UserName = "nils", Email = "nils@nils.com", Password = "nils" };
  6. //User tempUser2 = new User { UserName = "simon", Email = "simon@simon.com", Password = "simon"};
  7. //User tempUser3 = new User { UserName = "harry", Email = "harry@harry.com", Password = "harry" };
  8.  
  9. //context.Users.Add(tempUser);
  10. //context.Users.Add(tempUser2);
  11. //context.Users.Add(tempUser3);
  12.  
  13. //context.SaveChanges();
  14.  
  15. //List<Category> categories = new List<Category>();
  16.  
  17. //Category cat1 = new Category { Name = "War", Creator = tempUser };
  18. //Category cat2 = new Category { Name = "Money", Creator = tempUser };
  19.  
  20. //categories.Add(cat1);
  21. //categories.Add(cat2);
  22.  
  23. //var cat3 = context.Categories.Where(x => x.Name == "Politics").FirstOrDefault();
  24. //var cat4 = context.Categories.Where(x => x.Name == "Others").FirstOrDefault();
  25.  
  26. //context.Categories.AddRange(categories);
  27. //context.SaveChanges();
  28.  
  29. //List<Article> articleList = new List<Article>
  30. //{
  31. // new Article {Heading="Conspiracy Files: Who shot down MH17?",
  32. // Author =tempUser2.UserId,
  33. // ImgAdress ="http://ichef-1.bbci.co.uk/news/976/cpsprodpb/3640/production/_89288831_wreckage.jpg",
  34. // Categories = new List<Category>{cat3},
  35. // Date = new DateTime(2016, 03, 30),
  36. // Text ="As the theory that MH17 was shot down by a plane not ground2air missile swept across the internet, Billy Six, a freelance journalistBerlin",
  37. // SourceAdress ="http://www.bbc.com/news/magazine-35706048" },
  38.  
  39. // new Article {Heading="Giant Umbrella to Stop Global Warming!",
  40. // Author= tempUser3.UserId,
  41. // Categories = new List<Category> {cat4, cat1, cat2 },
  42. // Date= new DateTime(2015, 05, 12),
  43. // Text="Our rapidly warming world could cause serious problems for civilisation in the decades to come. But could a giantumbrella help cool down?",
  44. // ImgAdress="http://ichef.bbci.co.uk/wwfeatures/1600_640/images/live/p0/3s/57/p03s57zw.jpg",
  45. // SourceAdress="http://www.bbc.com/future/story/20160425-how-a-giant-space-umbrella-could-stop-global-warming"
  46. // },
  47. // new Article {Heading="”Game of thrones” Fuck'd Up på HBO – People Hates",
  48. // Author = tempUser3.UserId,
  49. // VideoAdress="http://tv.aftonbladet.se/abtv/articles/120169?service=embedded&autoplay=false",
  50. // Categories=new List<Category> {cat1 },
  51. // Date = new DateTime(2016,04,25),
  52. // Text="The cult fantasy drama Game of Thrones begins its much-anticipated sixth season next Sunday",
  53. // SourceAdress="http://www.theguardian.com/media/2016/apr/17/game-of-thrones-hbo-vinyl-netflix"
  54. // }
  55. //};
  56.  
  57. //context.Articles.AddRange(articleList);
  58. //context.SaveChanges();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement