Ejemplo n.º 1
0
        public static bool CreateOrderStatuses(JuicyBurgerDbContext context)
        {
            if (!context.OrderStatuses.Any())
            {
                context.OrderStatuses.Add(new OrderStatus {
                    Name = ServicesGlobalConstants.OrderStatusActive
                });
                context.OrderStatuses.Add(new OrderStatus {
                    Name = ServicesGlobalConstants.OrderStatusFinish
                });
                //context.OrderStatuses.Add(new OrderStatus { Name = "Processing" });

                context.SaveChanges();
                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
        public static bool CreateRoles(JuicyBurgerDbContext context)
        {
            if (!context.Roles.Any())
            {
                context.Roles.Add(new IdentityRole
                {
                    Name           = ServicesGlobalConstants.Admin,
                    NormalizedName = ServicesGlobalConstants.AdminUpperCase
                });
                context.Roles.Add(new IdentityRole
                {
                    Name           = ServicesGlobalConstants.User,
                    NormalizedName = ServicesGlobalConstants.UserUpperCase
                });
                //context.Roles.Add(new IdentityRole { Name = "Dasher", NormalizedName = "DASHER" });

                context.SaveChanges();
                return(true);
            }

            return(false);
        }
 public IngredientsService(JuicyBurgerDbContext context)
 {
     this.context = context;
 }
Ejemplo n.º 4
0
 public ProductsService(JuicyBurgerDbContext context, IIngredientsService ingredientsService)
 {
     this.context            = context;
     this.ingredientsService = ingredientsService;
 }
Ejemplo n.º 5
0
 public OrdersService(JuicyBurgerDbContext context)
 {
     this.context = context;
 }
Ejemplo n.º 6
0
 public RestaurantsService(JuicyBurgerDbContext context)
 {
     this.context = context;
 }
Ejemplo n.º 7
0
 public ReceiptService(JuicyBurgerDbContext context, IOrdersService ordersService)
 {
     this.context       = context;
     this.ordersService = ordersService;
 }