public ArticlesController(UsenetContext context) { _context = context; if (_context.Articles.Count() == 0) { _context.Articles.Add(new Article { GroupId = 1, Subject = "foo" }); _context.Articles.Add(new Article { GroupId = 1, Subject = "bar" }); _context.SaveChanges(); } }
public GroupsController(UsenetContext context) { _context = context; if (_context.Groups.Count() == 0) { _context.Groups.Add(new Group { Name = "Group1" }); _context.Groups.Add(new Group { Name = "Group2" }); _context.SaveChanges(); } }