Example #1
0
        public SongController(SongItemContext context)
        {
            _context = context;

            if (_context.SongItems.Count() == 0)
            {
                // Create a new SongItem if collection is empty,
                // which means you can't delete all SongItems.
                // _context.SongItems.Add(new SongItem { Name = "Item1" });
                _context.SaveChanges();
            }
        }
Example #2
0
 public SongController(SongItemContext context)
 {
     _context = context;
 }