public RecipeController(IRecipeProvider recipeProvider, ICategoryProvider categoryProvider, IIngridientProvider ingridientProvider) { ProvidersFactory factory = new ProvidersFactory(); if (recipeProvider != null) { _recipeProvider = recipeProvider; } else { _recipeProvider = factory.GetRecipeProvider(); } if (categoryProvider != null) { _categoryProvider = categoryProvider; } else { _categoryProvider = factory.GetCategoryProvider(); } if (ingridientProvider != null) { _ingridientProvider = ingridientProvider; } else { _ingridientProvider = factory.GetIngridientProvider(); } }
public IngridientController(IIngridientProvider ingridientProvider) { if (ingridientProvider != null) { _ingridientProvider = ingridientProvider; } else { ProvidersFactory factory = new ProvidersFactory(); _ingridientProvider = factory.GetIngridientProvider(); } }