public BookingRepo(BAMDBContext bdb) { this.bdb = bdb ?? throw new ArgumentNullException(nameof(bdb)); }
public BookingRepo() { bdb = new BAMDBContext(); }
public ClientRepo() { bdb = new BAMDBContext(); }
public TagRepo() { bdb = new BAMDBContext(); }
public static BAMDBContext getNewContext(string n) { var option = new DbContextOptionsBuilder <BAMDBContext>().UseInMemoryDatabase(databaseName: n).Options; var context = new BAMDBContext(option); var Venue1 = new Clients() { ClientName = "Alabama Coffee", Location = "Alabama", ClientPass = "******" }; var Venue2 = new Clients() { ClientName = "Brad's Bistro", Location = "Oregon", ClientPass = "******" }; var Performer1 = new Performers() { GroupName = "Zeal Seals", GroupPass = "******", PerformanceType = "Rock", Rating = "T", HourlyRate = 200, TotalCost = 10200, }; var Performer2 = new Performers() { GroupName = "Young Ones", GroupPass = "******", PerformanceType = "Mascot", Rating = "E", HourlyRate = 34, TotalCost = 68, }; var Booking1 = new Bookings() { GroupName = "Young Ones", ClientName = "Alabama Coffee", Review = "It was a fine performance", Score = 4, BookingId = 2, TimeFrame = "2/27/20", Location = "Alabama", BookingStatus = "Cancelled" }; var Booking2 = new Bookings() { GroupName = "Zeal Seals", ClientName = "Brad's Bistro", Review = "", Score = 2, BookingId = 3, TimeFrame = "6/2/16", Location = "Oregon", BookingStatus = "Upcoming" }; var Tag1 = new Tags() { Tag = "Loud", TagId = 5, GroupName = "Zeal Seals" }; var Tag2 = new Tags() { Tag = "Fun", TagId = 6, GroupName = "Zeal Seals" }; context.Add(Booking1); context.Add(Booking2); context.Add(Tag1); context.Add(Tag2); context.Add(Venue1); context.Add(Venue2); context.Add(Performer1); context.Add(Performer2); return(context); }