예제 #1
0
        public override IActionResult Post([FromBody] Episode value)
        {
            var season = SeasonRepository.Find(value.SeasonId);

            if (!ModelState.IsValid || season == null)
            {
                return(BadRequest(ModelState));
            }

            Repository.Add(value, autoSave: true);

            return(CreatedAtAction("Get", new { id = value.ID }, value));
        }