Exemplo n.º 1
0
        /// <summary>
        /// Konstruktor dla okna Sprawdz przepis, wymaga bazy danych <paramref name="context"/>
        /// </summary>
        /// <param name="context"></param>
        public Check(RecipeBookContext context) : base()
        {
            InitializeComponent();
            this._context = context;

            recipeList.ItemsSource = _context.Dishes.ToList();
        }
Exemplo n.º 2
0
        public Modify(RecipeBookContext context)
        {
            InitializeComponent();

            this._context = context;

            productTypeComboBox.ItemsSource = _context.ProductTypes.ToList();
            recipeList.ItemsSource          = _context.Dishes.ToList();
            productList.ItemsSource         = _context.Products.ToList();
            dishTypeComboBox.ItemsSource    = _context.DishTypes.ToList();
        }
Exemplo n.º 3
0
        private BookRepository InMemoryBookRepository()
        {
            DbContextOptions <RecipeBookContext> options;
            var builder = new DbContextOptionsBuilder <RecipeBookContext>();

            builder.UseInMemoryDatabase();
            options = builder.Options;
            RecipeBookContext recipeBookContext = new RecipeBookContext(options);

            recipeBookContext.Database.EnsureDeleted();
            recipeBookContext.Database.EnsureCreated();

            return(new BookRepository(recipeBookContext));
        }
Exemplo n.º 4
0
 public DishesController(RecipeBookContext context)
 {
     db = context;
 }
 public InstructionsController(RecipeBookContext db)
 {
     _db = db;
 }
 public ImagesControllerTests()
 {
     db         = new RecipeBookContext();
     controller = new ImagesController(db);
 }
Exemplo n.º 7
0
 public VarietiesController(RecipeBookContext context)
 {
     _context = context;
 }
 public IngredientsController(RecipeBookContext context)
 {
     _context = context;
 }
Exemplo n.º 9
0
 public HomeController(RecipeBookContext db)
 {
     _db = db;
 }
Exemplo n.º 10
0
 public ImagesController(RecipeBookContext context)
 {
     db = context;
 }
Exemplo n.º 11
0
        public void Setup()
        {
            Database.SetInitializer(new RecipeBookInitializer());
            context = new RecipeBookContext();

            productTypes = new List <ProductType>
            {
                new ProductType {
                    Type = "Owoc"
                },
                new ProductType {
                    Type = "Warzywo"
                },
                new ProductType {
                    Type = "Mięso"
                },
                new ProductType {
                    Type = "Ryba"
                },
                new ProductType {
                    Type = "Przyprawa"
                },
                new ProductType {
                    Type = "Nabiał"
                },
                new ProductType {
                    Type = "Produkt suchy"
                },
                new ProductType {
                    Type = "Wędlina"
                },
                new ProductType {
                    Type = "Olej"
                }
            };

            dishTypes = new List <DishType>
            {
                new DishType {
                    Type = "Wegetariańskie"
                },
                new DishType {
                    Type = "Wegańskie"
                },
                new DishType {
                    Type = "Bez glutenowe"
                },
                new DishType {
                    Type = "Pikantne"
                }
            };

            products = new List <Product>
            {
                new Product {
                    Name = "Jajka", ProductType = productTypes[5]
                },
                new Product {
                    Name = "Mąka", ProductType = productTypes[6]
                },
                new Product {
                    Name = "Masło", ProductType = productTypes[5]
                },
                new Product {
                    Name = "Kiełbasa", ProductType = productTypes[7]
                },
                new Product {
                    Name = "Boczek", ProductType = productTypes[2]
                },
                new Product {
                    Name = "Sól", ProductType = productTypes[4]
                },
                new Product {
                    Name = "Pieprz", ProductType = productTypes[4]
                },
                new Product {
                    Name = "Makaron Fusilli", ProductType = productTypes[6]
                },
                new Product {
                    Name = "Pomidor", ProductType = productTypes[1]
                },
                new Product {
                    Name = "Jabłko", ProductType = productTypes[0]
                },
                new Product {
                    Name = "Pieprz Cayenne", ProductType = productTypes[4]
                },
                new Product {
                    Name = "Oliwa", ProductType = productTypes[8]
                },
                new Product {
                    Name = "Parmezan", ProductType = productTypes[5]
                },
                new Product {
                    Name = "Czosnek", ProductType = productTypes[1]
                }
            };

            recipes = new List <Dish>
            {
                new Dish {
                    Name     = "Jajecznica", Description = "Smażony mix jajek na maśle z solą i pieprzem.",
                    DishType = dishTypes[0],
                    Products = { products[0], products[2], products[5], products[6] }
                },
                new Dish {
                    Name     = "Fusilli aglio e olio", Description = "Makaron typu fusilli z oliwa i czosnkiem. Po wyłożeniu należy posypać tartym parmezanem.",
                    DishType = dishTypes[1],
                    Products = { products[5], products[6], products[7], products[11], products[12], products[13] }
                }
            };
        }
Exemplo n.º 12
0
 public SearchController(RecipeBookContext context)
 {
     db = context;
 }
Exemplo n.º 13
0
 public RecipeBookService(RecipeBookContext recipeBookContext)
 {
     _recipeBookContext = recipeBookContext;
 }
 public CategoriesControllerTests()
 {
     db         = new RecipeBookContext();
     controller = new CategoriesController(db);
 }
Exemplo n.º 15
0
 public UsersController(RecipeBookContext context, ISigningSymmetricKey signingSymmetricKey)
 {
     db = context;
     this.signingSymmetricKey = signingSymmetricKey;
 }
 public DishesControllerTests()
 {
     db         = new RecipeBookContext();
     controller = new DishesController(db);
 }
Exemplo n.º 17
0
 public TagsController(RecipeBookContext db)
 {
     _db = db;
 }
Exemplo n.º 18
0
 public Home()
 {
     InitializeComponent();
     this.context = new RecipeBookContext();
 }
Exemplo n.º 19
0
 public IngredientsController(RecipeBookContext db)
 {
     _db = db;
 }
Exemplo n.º 20
0
 public AmountsController(RecipeBookContext context)
 {
     _context = context;
 }
Exemplo n.º 21
0
 public RecipesController(UserManager <ApplicationUser> userManager, RecipeBookContext db)
 {
     _userManager = userManager;
     _db          = db;
 }
Exemplo n.º 22
0
 public IngredientsControllerTests()
 {
     db         = new RecipeBookContext();
     controller = new IngredientsController(db);
 }
Exemplo n.º 23
0
 public UsersControllerTests()
 {
     db = new RecipeBookContext();
     signingSymmetricKey = new SigningSymmetricKey("zigmuntkyzaneusedelka228");
     controller          = new UsersController(db, signingSymmetricKey);
 }
Exemplo n.º 24
0
 public TagService(RecipeBookContext recipeDb)
 {
     _recipeDb = recipeDb;
 }
Exemplo n.º 25
0
 public CategoriesController(RecipeBookContext db)
 {
     _db = db;
 }
 public AccountController(UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, RecipeBookContext db)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _db            = db;
 }
Exemplo n.º 27
0
 public RecipeRepository(RecipeBookContext context) : base(context)
 {
 }
Exemplo n.º 28
0
 public HomeController(ILogger <HomeController> logger, RecipeBookContext context)
 {
     _logger = logger;
     db      = context;
 }
Exemplo n.º 29
0
 public RecipesController(RecipeBookContext context)
 {
     _context = context;
 }
 public CategoriesController(RecipeBookContext context)
 {
     db = context;
 }