Пример #1
0
        public async Task <IActionResult> AddSeason(int tvSeriesId, [FromBody] AddSeasonBindingModel seasonBindingModel)
        {
            var result = await _seasonService.AddSeason(tvSeriesId, seasonBindingModel);

            if (result.ErrorOccurred)
            {
                return(BadRequest(result));
            }

            return(Ok(result));
        }
Пример #2
0
 public IActionResult Season([FromBody] MvSeason season)
 {
     try
     {
         int seasonId = seasonService.AddSeason(season);
         return(Ok(seasonId));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }