コード例 #1
0
        public IActionResult Create(int id)
        {
            var model = new AddQueenBeePostModel()
            {
                BeehiveId = id,
            };

            return(this.View(model));
        }
コード例 #2
0
        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"));
        }