public async Task <IActionResult> Edit(int id, [Bind("Id,AssignedBy,DateAssigned,ServiceRequest,Team")] TeamAssignmentHistories teamAssignmentHistories)
        {
            if (id != teamAssignmentHistories.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(teamAssignmentHistories);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TeamAssignmentHistoriesExists(teamAssignmentHistories.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ServiceRequest"] = new SelectList(_context.ServiceRequests, "Id", "RequestDescription", teamAssignmentHistories.ServiceRequest);
            ViewData["Team"]           = new SelectList(_context.Teams, "Id", "TeamDescription", teamAssignmentHistories.Team);
            return(View(teamAssignmentHistories));
        }
        public async Task <IActionResult> Create([Bind("Id,AssignedBy,DateAssigned,ServiceRequest,Team")] TeamAssignmentHistories teamAssignmentHistories)
        {
            if (ModelState.IsValid)
            {
                _context.Add(teamAssignmentHistories);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ServiceRequest"] = new SelectList(_context.ServiceRequests, "Id", "RequestDescription", teamAssignmentHistories.ServiceRequest);
            ViewData["Team"]           = new SelectList(_context.Teams, "Id", "TeamDescription", teamAssignmentHistories.Team);
            return(View(teamAssignmentHistories));
        }