Beispiel #1
0
        public int SaveNewWine(SaveNewWineRequest request)
        {
            var newWine = new Wine
            {
                Winery   = request.Winery,
                Name     = request.Name,
                Category = request.Category,
            };

            _context.SaveChanges();

            return(newWine.ID);
        }
Beispiel #2
0
        public IActionResult CreateWine([FromBody] SaveNewWineRequest request)
        {
            var id = _wineService.SaveNewWine(request);

            return(Created($"/api/wines/{id}", id));
        }