public IActionResult Create(ProblemInputModel input) { if (!this.ModelState.IsValid) { return(this.Redirect("/Problems/Create")); } this.problemsService.CreateProblem(input.Name, input.Points); return(this.Redirect("/")); }
public IActionResult Create(ProblemInputModel model) { if (!this.ModelState.IsValid) { return(this.View()); } this.problemService.CreateProblem(model.Name, model.Points); return(this.Redirect("/")); }
public HttpResponse Create(ProblemInputModel problemInput) { if (!this.IsUserLoggedIn()) { return(this.Redirect("/Users/Login")); } this.problemsService.CreateProblem(problemInput.Header, problemInput.Description, this.User); return(this.Redirect("/Problems/List")); }
public IActionResult Create(ProblemInputModel input) { if (!ModelState.IsValid) { return(this.Redirect("/Problems/Create")); } problemService.CreateProblem(input.Name, input.Points, input.UserId); return(this.Redirect("/Home/Index")); }
public IActionResult Create(ProblemInputModel model) { if (!ModelState.IsValid) { return(this.Redirect("/Problems/Create")); } this.problemsService.CreateProblem(model.Name, model.TotalPoints, model.UserId); return(this.Redirect("/")); }
public IActionResult Create(ProblemInputModel model) { if (!ModelState.IsValid) { return(Redirect("/Problems/Create")); } var problem = new Problem() { Name = model.Name, Points = model.Points }; problemService.Create(problem); return(Redirect("/")); }
public HttpResponse Create(ProblemInputModel input) { if (!this.IsLoggedIn()) { return(this.Redirect(this.homeUrl)); } var problem = new Problem { Name = input.Name, Points = input.Points }; this.problemsService.Create(problem); return(this.Redirect(this.homeUrl)); }