public IActionResult Post(Printer printer) { if (_printerRepository.GetPrinterByDeviceIdentifier(printer.DeviceIdentifier) != null) { return(BadRequest()); } _printerRepository.Add(printer); return(base.Created("", printer)); }
public IActionResult PrinterAdd(Printer newPrinter) { _printerRepository.Add(newPrinter); ModelState.Clear(); return(View()); }