public async Task <ActionResult <int> > Create([Required] TaskDto task) { var myTask = new Common.Models.Task { Description = task.Description, Title = task.Title }; await _taskDatabase.Add(myTask); return(myTask.Id); }
// To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://aka.ms/RazorPagesCRUD. public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } await _taskContext.Add(Task); return(Redirect("/Projects/Details?id=" + Task.ProjectId)); }