예제 #1
0
        public async Task <bool> UpdateImage(int id, SeriesImageModel model)
        {
            var pathParams = new HttpPathParameters();

            pathParams.Add <int>(id, -1);

            var settings = new HttpSettings($"{this.Url}/image", null, pathParams, "Series image updating");

            var body = new HttpBody <SeriesImageModel>(model);

            return(await this.Http.Update <SeriesImageModel>(settings, body));
        }
예제 #2
0
        /// <summary>
        /// Updates series's image.
        /// </summary>
        /// <param name="id">Series Id</param>
        /// <param name="model">New image model</param>
        public void UpdateImage(int id, SeriesImageModel model)
        {
            var series = this._databaseContext.Series.Find(id);

            if (series == null)
            {
                return;
            }

            this.Mapper.Map(model, series);

            this.Update(series);
        }
예제 #3
0
 public IActionResult UpdateImage(int id, [FromBody] SeriesImageModel model)
 {
     this._seriesService.UpdateImage(id, model);
     return(this.Ok());
 }