public IHttpActionResult Cancelreservation(int transid, DateTime cancel_date) { try { var trans = db.Transactions.Where(x => x.transaction_id == transid).FirstOrDefault(); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (trans != null) { trans.cancellation_status = true; db.Entry(trans).State = EntityState.Modified; var pass = from p in db.passengers where p.transaction_id == transid select p; foreach (var p in pass) { db.passengers.Remove(p); } cancellation can = new cancellation(); can.transaction_id = transid; can.cancellation_date = cancel_date; can.cancellation_amount = trans.amount / 4; db.cancellations.Add(can); try { db.SaveChanges(); } catch (DbUpdateException) { return(NotFound()); } return(Ok(can)); } else { return(BadRequest("Transaction Id does not exist")); } } catch (Exception ex) { return(BadRequest(ex.ToString())); } }
=> (accessQueue ?? throw new ArgumentNullException(nameof(accessQueue))).AccessAsync(accesses, priority, cancellation, attemptsCount, enqueueAll);
?.EnqueueAsyncWork(work, priority, cancellation, attemptsCount) ?? provider.RequiredService <IWorkQueue>().EnqueueAsyncWork(work, cancellation, attemptsCount);
?.EnqueueAsyncAccess(access, priority, cancellation, attemptsCount) ?? provider.RequiredService <IAccessQueue <TResource> >().EnqueueAsyncAccess(access, cancellation, attemptsCount);
=> (conveyor ?? throw new ArgumentNullException(nameof(conveyor))).ProcessDataAsync(data, priority, cancellation, attemptsCount, enqueueAll);
?.ProcessDataAsync(data, priority, cancellation, attemptsCount) ?? provider.RequiredService <IConveyor <TData, TResult> >().ProcessDataAsync(data, cancellation, attemptsCount);
=> (queue ?? throw new ArgumentNullException(nameof(queue))).DoWorkAsync(works, priority, cancellation, attemptsCount, enqueueAll);