public void AddNewTable(Table table) { if (table != null && GetTableByTableNumber(table.TableNumber) == null) { _serv.AddNewTable(table); } }
public async Task <IActionResult> NewTable(NewTableViewModel model) { var mapped = _mapper.Map <Table>(model); await _tableService.AddNewTable(mapped, User.Identity.Name); return(RedirectToAction(nameof(Tables))); }