public void RemoveTask(int taskID) { var taskToRemove = _dbContext.MatrixTasks.SingleOrDefault(x => x.MatrixTaskID == taskID); if (taskToRemove != null) { _dbContext.MatrixTasks.Remove(taskToRemove); } _dbContext.SaveChanges(); }
public IActionResult OnPost() { if (!ModelState.IsValid) { return(Page()); } ctx.Mensagems.Add(Mensagem); ctx.SaveChanges(); return(RedirectToPage("./Sucesso")); }
public void Create(Matrix elements) { matrixContext.Add(elements); matrixContext.SaveChanges(); }
//Crud public void CreateMatrix(Matrix matrix) { Context.Matrices.Add(matrix); Context.SaveChanges(); }