Ejemplo n.º 1
0
        private static void SeedOrderState(OrderingContext context, Guid id, string name)
        {
            if (!context.OrderStates.Any(x => x.Id == id && x.IsActive))
            {
                var orderState = new OrderState
                {
                    Id   = id,
                    Name = name
                };

                context.OrderStates.Add(orderState.FillCommonProperties());

                context.SaveChanges();
            }
        }