public static List <Booking> GetBookings(YachtClubDbContext db) { List <Booking> bookings = new List <Booking> { new Booking { BookingId = "C0001", StartDateTime = new DateTime(2018, 6, 30, 6, 0, 0), EndDateTime = new DateTime(2018, 6, 30, 12, 0, 0), CreditsUsed = 36, Boat = db.Boats.FirstOrDefault(b => b.Name == "Y-Knot"), User = db.Users.FirstOrDefault(u => u.Email == "[email protected]") }, new Booking { BookingId = "C0002", StartDateTime = new DateTime(2018, 7, 1, 20, 0, 0), EndDateTime = new DateTime(2018, 7, 2, 6, 0, 0), CreditsUsed = 60, Boat = db.Boats.FirstOrDefault(b => b.Name == "Y-Knot"), User = db.Users.FirstOrDefault(u => u.Email == "[email protected]") }, new Booking { BookingId = "C0003", StartDateTime = new DateTime(2018, 7, 30, 1, 0, 0), EndDateTime = new DateTime(2018, 7, 30, 18, 0, 0), CreditsUsed = 102, Boat = db.Boats.FirstOrDefault(b => b.Name == "Y-Knot"), User = db.Users.FirstOrDefault(u => u.Email == "[email protected]") }, new Booking { BookingId = "C0004", StartDateTime = new DateTime(2018, 7, 30, 1, 0, 0), EndDateTime = new DateTime(2018, 7, 30, 18, 0, 0), CreditsUsed = 102, Boat = db.Boats.FirstOrDefault(b => b.Name == "White Swan"), User = db.Users.FirstOrDefault(u => u.Email == "[email protected]") }, new Booking { BookingId = "C0005", StartDateTime = new DateTime(2018, 1, 1, 10, 0, 0), EndDateTime = new DateTime(2018, 1, 1, 13, 0, 0), CreditsUsed = 18, Boat = db.Boats.FirstOrDefault(b => b.Name == "Y-Knot"), User = db.Users.FirstOrDefault(u => u.Email == "[email protected]") }, }; return(bookings); }
public DocumentsController(YachtClubDbContext context, IServiceProvider services) { _context = context; _services = services; }
public UsersController(YachtClubDbContext context, UserManager <User> userManager) { _context = context; _userManager = userManager; }
public ReportsController(YachtClubDbContext context) { _context = context; }
public UsersController(YachtClubDbContext context) { _context = context; }
public BoatsController(YachtClubDbContext context) { _context = context; }
public RolesController(YachtClubDbContext db, UserManager <User> userManager, RoleManager <IdentityRole> roleManager) { _context = db; _userManager = userManager; _roleManager = roleManager; }