Beispiel #1
0
        private ProductGtin CreateBrew(AlcoholicEntity alcoholicEntity)
        {
            var first = alcoholicEntity.Logistics.Barcodes.FirstOrDefault(barcode => barcode.IsMainGtin);

            return(new ProductGtin
            {
                Gtin = first?.Gtin ?? "",
                ProductId = alcoholicEntity.Basic.ProductId
            });
        }
Beispiel #2
0
        private async Task CreateFood(AlcoholicEntity entity)
        {
            foreach (var food in entity.Description.RecommendedFood)
            {
                var find = await m_db.Foods.FindAsync(food.FoodId);

                if (find == null)
                {
                    m_db.Foods.Add(food);
                    await m_db.SaveChangesAsync();

                    Logger.Log($"Food created: {food.FoodDesc}");
                }
            }
        }
Beispiel #3
0
        private async Task CreateGrape(AlcoholicEntity alcoholicEntity)
        {
            foreach (var grape in alcoholicEntity.Ingredients.Grapes)
            {
                var find = await m_db.Grapes.FindAsync(grape.GrapeId);

                if (find == null)
                {
                    m_db.Grapes.Add(grape);
                    await m_db.SaveChangesAsync();

                    Logger.Log($"Grape created: {grape.GrapeDesc}");
                }
            }
        }