Example #1
0
        public Beer CreateBeer(CreateBeerCommand command)
        {
            var brewer = _brewerRepository.FindBrewerById(command.BrewerId);

            if (brewer == null)
            {
                return(null);
            }

            var beer = new Beer
            {
                Name = command.Name,
                AlcoholPercentage = command.AlcoholPercentage,
                Price             = command.Price,
                Brewer            = brewer
            };

            _beerRepository.CreateBeer(beer);

            return(beer);
        }
        public Brewer FindBrewerById(int Id)
        {
            var brewer = _brewerRepository.FindBrewerById(Id);

            return(brewer);
        }