public GuitarsRepository(GuitarContext context) { db = context; if (db.Guitars.Count() == 0) { db.Guitars.Add(GetYamahaPacifica012()); db.Guitars.Add(GetGibsonLesPaul()); db.Guitars.Add(GetFenderStratocaster()); db.SaveChangesAsync(); } }
public GuitarsRepository() { db = new GuitarContext(); }
public GuitarsController(GuitarContext context) { guitars = new GuitarsRepository(context); }