public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] Gpuinterface gpuinterface) { if (id != gpuinterface.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(gpuinterface); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GpuinterfaceExists(gpuinterface.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(gpuinterface)); }
public async Task <IActionResult> Create([Bind("Id,Name")] Gpuinterface gpuinterface) { if (ModelState.IsValid) { _context.Add(gpuinterface); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(gpuinterface)); }
public ICollection <Gpuinterface> getGpuInterfacesFromExcel(XLWorkbook workBook) { ICollection <Gpuinterface> result = new List <Gpuinterface>(); var worksheet = workBook.Worksheet("Інтерфейси відеокарт"); foreach (IXLRow row in worksheet.RowsUsed().Skip(1)) { var item = new Gpuinterface(); //item.Id = int.Parse(row.Cell(1).Value.ToString()); item.Name = row.Cell(2).Value.ToString(); result.Add(item); } return(result); }