public async Task <IActionResult> Create([Bind("Id,Name,FirstName,UserId,ClientId,Status")] Reception reception) { if (ModelState.IsValid) { _context.Add(reception); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["PhoneId"] = new SelectList(_context.Clients, "Id", "Id", reception.ClientId); return(View(reception)); }
public async Task <IActionResult> Delete(int?id) { var client = _context.Clients.FirstOrDefault(p => p.ClientId == id); _context.Clients.Remove(client); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); }