public void CheckInItem(int itemId) { //get the item var item = GetItem(itemId); //get he checkout instance var checkout = _context.Checkouts.FirstOrDefault(c => c.Item.Id == itemId); _context.Remove(checkout); //check if there is any hold on this item var holds = CheckHolds(itemId); //check is it returns true (holds available) if (holds.Any()) { var oldest = holds.OrderBy(h => h.HoldDate).FirstOrDefault(); var student = oldest.Student; var months = oldest.chosenMonths; _context.Remove(oldest); CheckoutItem(item, student, months); return; } UpdateStatus(itemId, "Beschikbaar"); _context.SaveChanges(); }
public void Delete(int id) { var student = Get(id); _context.Remove(student); _context.SaveChanges(); }
public void Delete(int id) { var employee = Get(id); _context.Remove(employee); _context.SaveChanges(); }
public void Delete(int id) { var item = GetById(id); _context.Remove(item); _context.SaveChanges(); }