public IActionResult Create(int id) { var model = new AddQueenBeePostModel() { BeehiveId = id, }; return(this.View(model)); }
public IActionResult Create(AddQueenBeePostModel input) { if (this.ModelState.IsValid == false) { return(this.View(input)); } var beehive = this.beehiveService.FindById(input.BeehiveId); this.queenBeeService.CreateAsync( input.BeehiveId, input.QueenType, input.MarkingColour, input.Origin, input.Temper); return(this.RedirectToAction("ViewAll", "Beehives")); }