コード例 #1
0
        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);
        }
コード例 #2
0
 public DocumentsController(YachtClubDbContext context, IServiceProvider services)
 {
     _context  = context;
     _services = services;
 }
コード例 #3
0
 public UsersController(YachtClubDbContext context, UserManager <User> userManager)
 {
     _context     = context;
     _userManager = userManager;
 }
コード例 #4
0
 public ReportsController(YachtClubDbContext context)
 {
     _context = context;
 }
コード例 #5
0
 public UsersController(YachtClubDbContext context)
 {
     _context = context;
 }
コード例 #6
0
 public BoatsController(YachtClubDbContext context)
 {
     _context = context;
 }
コード例 #7
0
ファイル: RolesController.cs プロジェクト: nate-thomas/LMYC-
 public RolesController(YachtClubDbContext db, UserManager <User> userManager, RoleManager <IdentityRole> roleManager)
 {
     _context     = db;
     _userManager = userManager;
     _roleManager = roleManager;
 }