Пример #1
0
        public FilmModel AddFilm(NewFilmModel model)
        {
            var film = new Film()
            {
                FilmDescription = model.FilmDescription,
                FilmTitle       = model.FilmTitle
            };

            var filmentity = _dbContext.Films.Add(film);

            _dbContext.SaveChanges();

            return(new FilmModel()
            {
                FilmId = filmentity.Entity.FilmId,
                FilmDescription = filmentity.Entity.FilmDescription,
                FilmTitle = filmentity.Entity.FilmTitle,
            });
        }
Пример #2
0
 public void Post([FromBody] NewFilmModel model)
 {
     _filmsService.AddFilm(model);
 }