示例#1
0
        public void Create(GenreWithoutIdModel model)
        {
            var newGenre = new Genre
            {
                Id   = Guid.NewGuid().ToString(),
                Name = model.Name
            };

            db.Genres.Add(newGenre);

            db.SaveChanges();
        }
示例#2
0
        public async Task <IActionResult> Create([FromBody] GenreWithoutIdModel model)
        {
            manager.Create(model);

            return(Ok());
        }
示例#3
0
 public void Create(GenreWithoutIdModel model)
 {
     repository.Create(model);
 }