コード例 #1
0
        public async Task <bool> AddReservationAsync(Reservations reservations)
        {
            //var user = new IdentityUser();
            //user.Id = userManager.GetUserId(ClaimsPrincipal.Current);

            //var reserv = new Reservations()
            //{
            //    RentFromDate = reservations.RentFromDate,
            //    RentToDate = reservations.RentToDate,
            //    MachineId = machineId,
            //};

            await _context.Reservations.AddAsync(reservations);

            return(await _context.SaveChangesAsync() > 0);
        }
コード例 #2
0
        public async Task <bool> CreateAsync(Machines machines)
        {
            await _context.Machines.AddAsync(machines);

            return(await _context.SaveChangesAsync() > 0);
        }