public async Task <IActionResult> CreateCell(CellCreateViewModel model) { if (ModelState.IsValid) { var cell = new Cell(model); try { repository.Add(cell); } catch (Exception ex) { throw new Exception("Erro ao salvar Célula", ex); } return(RedirectToAction("list", "event")); } return(await ReloadDataAndReturnView()); }
public Cell(CellCreateViewModel model) { Date = model.Date; Convertions = model.Convertions; EventType = EventType.CÉLULA; }