コード例 #1
0
        public void MYSQLDbAccessTests()
        {
            List <int> recipesIds = MySQLDbAccess.GetRecipesIdsThatContainsIngredients(new List <Ingredient>()
            {
                new Ingredient()
                {
                    Id = 283, Name = "Açucar"
                }
            }, new RecipeType()
            {
                Id = 3, Name = "Vegetariano"
            });

            List <Unit>          units      = MySQLDbAccess.GetAllUnits();
            List <ApplianceType> appliances = MySQLDbAccess.GetAllApplianceTypes();
            Recipe recipe = MySQLDbAccess.GetRecipeById(2);

            //List<int> recipesIds = MySQLDbAccess.GetRecipesIdsThatContainsIngredients(new List<Ingredient>() { new Ingredient() { Id = 24, Name = "Banana" } });
            List <Ingredient> ingredients    = MySQLDbAccess.GetAllIngredients();
            Ingredient        ingredient     = MySQLDbAccess.GetIngredientById(111);
            Ingredient        ingredient2    = MySQLDbAccess.GetIngredientByName("Limão");
            User                  user       = MySQLDbAccess.GetUserById(1);
            RecipeType            recipeType = MySQLDbAccess.GetRecipeTypeById(1);
            Unit                  unit       = MySQLDbAccess.GetUnitTypeById(1);
            List <IngredientInfo> infos      = MySQLDbAccess.GetIngredientInfosFromRecipe(1);
        }
コード例 #2
0
        public App()
        {
            InitializeComponent();
#if DEBUG
            HotReloader.Current.Run(this);
#endif
            Utils.AllIngridients = MySQLDbAccess.GetAllIngredients();
            Utils.AllUnits       = MySQLDbAccess.GetAllUnits();
            Utils.AllRecipeTypes = MySQLDbAccess.GetAllRecipeTypes();
            Utils.AllAppliances  = MySQLDbAccess.GetAllApplianceTypes();

            MainPage = new NavigationPage(new MainPage());
        }