Example #1
0
 public RecipeController(
     RecipeFacade recipeFacade,
     IngredientFacade ingredientFacade)
 {
     _recipeFacade     = recipeFacade;
     _ingredientFacade = ingredientFacade;
 }
Example #2
0
        static void Main(string[] args)
        {
            IngredientFacade ingredientFacade = new IngredientFacade();


            List <IngredientModel> ingredientModels = new List <IngredientModel>();

            ingredientModels.Add(ingredientFacade.GetById(1));


            RecipeFacade recipeFacade = new RecipeFacade();

            RecipeModel recipeModel = new RecipeModel
            {
                CookingDifficulty         = CookingDifficulties.Hard,
                CreateDate                = DateTime.Now,
                Category                  = Categories.Dušení,
                NumberOfServings          = 5,
                PreparationProcess        = "Uvařte pokapte snězte",
                RecipeName                = "Bábovka",
                TimeToBakeAndCookInMinits = 50,
                TimeToPrepareInMinits     = 70,
                Ingredients               = ingredientModels,
                AuthorId                  = 1,
            };

            Console.WriteLine(recipeFacade.GetById(2).CookingDifficulty);
        }
Example #3
0
 public RecipeController(
     RecipeFacade recipeFacade,
     IngredientFacade ingredientFacade,
     ISerializerService serializerService)
 {
     _recipeFacade          = recipeFacade;
     _ingredientFacade      = ingredientFacade;
     this.serializerService = serializerService;
 }
Example #4
0
        public RecipeListViewModel(RecipeFacade recipeFacade, IMediator mediator)
        {
            _recipeFacade = recipeFacade;
            _mediator     = mediator;

            RecipeSelectedCommand = new RelayCommand <RecipeListModel>(RecipeSelected);
            RecipeNewCommand      = new RelayCommand(RecipeNew);

            mediator.Register <UpdateMessage <RecipeWrapper> >(RecipeUpdated);
            mediator.Register <DeleteMessage <RecipeWrapper> >(RecipeDeleted);
        }
Example #5
0
        public RecipeDetailViewModel(
            RecipeFacade recipeFacade,
            IMessageDialogService messageDialogService,
            IMediator mediator,
            IIngredientAmountDetailViewModel ingredientAmountDetailViewModel)
        {
            _recipeFacade                   = recipeFacade;
            _messageDialogService           = messageDialogService;
            _mediator                       = mediator;
            IngredientAmountDetailViewModel = ingredientAmountDetailViewModel;

            SaveCommand   = new AsyncRelayCommand(SaveAsync, CanSave);
            DeleteCommand = new AsyncRelayCommand(DeleteAsync);

            mediator.Register <NewMessage <IngredientAmountWrapper> >(NewIngredientAmount);
            mediator.Register <UpdateMessage <IngredientAmountWrapper> >(UpdateIngredientAmount);
            mediator.Register <DeleteMessage <IngredientAmountWrapper> >(DeleteIngredientAmount);
        }
Example #6
0
 public RecipeController(RecipeFacade recipeFacade)
 {
     this.recipeFacade = recipeFacade;
 }
Example #7
0
 public RecipeFacadeTests(ITestOutputHelper output) : base(output)
 {
     _facadeSUT = new RecipeFacade(UnitOfWorkFactory, Mapper);
 }
Example #8
0
 public RecipeController(RecipeFacade facade)
 {
     _facade = facade;
 }
Example #9
0
        protected override async Task OnInitializedAsync()
        {
            Recipes = await RecipeFacade.GetRecipesAsync();

            await base.OnInitializedAsync();
        }