Beispiel #1
0
        public Article CreateArticle(Article article)
        {
            _logger.LogDebug($"Creating article: {article}");
            var created = _context.Articles.Add(article).Entity;

            _context.SaveChanges();
            return(created);
        }
Beispiel #2
0
        public Order CreateOrder(Order order)
        {
            order.OrderRef    = Guid.NewGuid();
            order.CreatedDate = DateTime.Now;
            var created = _context.Orders.Add(order).Entity;

            _context.SaveChanges();
            return(created);
        }
Beispiel #3
0
        public BasketItem CreateBasketItem(BasketItem basketItem)
        {
            _logger.LogDebug($"Creating basket item: {basketItem}");
            basketItem.BasketItemRef = Guid.NewGuid();
            var createdItem = _context.BasketItems.Add(basketItem).Entity;

            _context.SaveChanges();
            return(createdItem);
        }