コード例 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            IBagFactory    bagFactory = new DefaultBagFactory();
            IBagService    bagService = bagFactory.GetBagService();
            IAnimalFactory factory    = new AnimalFactory();

            bagService.AddAnimal(factory.CreateAnimal("mops", 3, AnimalType.OKKAM));
            bagService.AddAnimal(factory.CreateAnimal("sharpey", 3, AnimalType.OKKAM));
            bagService.SetDay();
            Console.WriteLine("NovDay");
            Console.WriteLine(bagService.CommandVoiceToConcreteAnimal("mops"));
            Console.WriteLine(bagService.CommandVoiceToConcreteAnimal("sharpey"));
            Console.WriteLine(bagService.CommandVoiceToAllAnimals());
            bagService.SetNight();
            Console.WriteLine("NovNight");
            Console.WriteLine(bagService.CommandVoiceToConcreteAnimal("mops"));
            Console.WriteLine(bagService.CommandVoiceToConcreteAnimal("sharpey"));
            try
            {
                Console.WriteLine(bagService.CommandVoiceToAllAnimals());
            }
            catch (CallAllAnimalsAtNightException e)
            {
                Console.WriteLine(e.GetType());
            }
            Console.WriteLine("GetTotalFoodWeightPerDay");
            Console.WriteLine(bagService.GetTotalFoodWeightPerDay());
            Console.WriteLine("CountAllAnimals");
            Console.WriteLine(bagService.CountAllAnimals());
            Console.WriteLine("GetAverageFoodWeightPerAnimal");
            Console.WriteLine(bagService.GetAverageFoodWeightPerAnimal());
        }
コード例 #2
0
 public ProductsController(
     IProductsService productsService,
     ICategoryService categoryService,
     IBagService bagService,
     UserManager <ApplicationUser> userManager,
     IDiscountsService discountsService)
 {
     this.productsService  = productsService;
     this.categoryService  = categoryService;
     this.bagService       = bagService;
     this.userManager      = userManager;
     this.discountsService = discountsService;
 }
コード例 #3
0
 public AdministrationController(
     IProductsService productsService,
     IImgService imgService,
     ICategoryService categoryService,
     IBagService bagService,
     IOrderDataService orderDataService,
     IDiscountsService discountsService)
 {
     this.productsService  = productsService;
     this.imgService       = imgService;
     this.categoryService  = categoryService;
     this.bagService       = bagService;
     this.orderDataService = orderDataService;
     this.discountsService = discountsService;
 }
コード例 #4
0
        public HomeController(UserManager <User> userManager, IBagService bagService)
        {
            var user = this.userManager;

            this.bagService = bagService;
        }
コード例 #5
0
 public BagController(IBagService bagService, UserManager <ApplicationUser> userManager, IDiscountsService discountsService)
 {
     this.bagService       = bagService;
     this.userManager      = userManager;
     this.discountsService = discountsService;
 }
コード例 #6
0
 public BagsController(IBagService bagService,
                       UserManager <User> userManager)
 {
     this.bagService  = bagService;
     this.userManager = userManager;
 }