コード例 #1
0
 public BarsController(IBarsService service, IBarViewMapper mapper, ICocktailViewMapper cocktailMapper, ICocktailsService cocktailService)
 {
     _service         = service ?? throw new ArgumentNullException("Bar service not found");
     _mapper          = mapper ?? throw new ArgumentNullException("Mapper not found");
     _cocktailMapper  = cocktailMapper ?? throw new ArgumentNullException("Mapper not found");
     _cocktailService = cocktailService ?? throw new ArgumentNullException("Cocktail service not found");
 }
コード例 #2
0
 public BarsController(IBarsService barsService,
                       UserManager <IdentityUser> userManager,
                       ApplicationDbContext db)
 {
     this.db          = db;
     this.barsService = barsService;
     this.userManager = userManager;
 }
コード例 #3
0
 public HomeController(ILogger <HomeController> logger
                       , IBarsService barsService
                       , ICocktailsService cocktailsService
                       , IBarViewMapper barMapper
                       , ICocktailViewMapper cocktailMapper)
 {
     _logger           = logger;
     _barsService      = barsService;
     _cocktailsService = cocktailsService;
     _barMapper        = barMapper;
     _cocktailMapper   = cocktailMapper;
 }
コード例 #4
0
        public HomeController(IMappingService mappingService,
                              IBarsService barsService)
        {
            if (mappingService == null)
            {
                throw new ArgumentNullException("Mapping service cannot be null.");
            }

            if (barsService == null)
            {
                throw new ArgumentNullException("Bars service cannot be null.");
            }

            this.mappingService = mappingService;
            this.barsService    = barsService;
        }
コード例 #5
0
        public AddBarController(IMappingService mappingService,
                                IRegionsService regionsService,
                                IBarsService barsService,
                                ICacheProvider cacheProvider,
                                IServerProvider serverProvider,
                                IPathProvider pathProvider)
        {
            if (mappingService == null)
            {
                throw new ArgumentNullException("Mapping service cannot be null.");
            }

            if (regionsService == null)
            {
                throw new ArgumentNullException("Regions service cannot be null.");
            }

            if (barsService == null)
            {
                throw new ArgumentNullException("Bars service cannot be null.");
            }

            if (cacheProvider == null)
            {
                throw new ArgumentNullException("Cache provider cannot be null.");
            }

            if (serverProvider == null)
            {
                throw new ArgumentNullException("Server provider cannot be null.");
            }

            if (pathProvider == null)
            {
                throw new ArgumentNullException("Path provider cannot be null.");
            }

            this.mappingService = mappingService;
            this.regionsService = regionsService;
            this.barsService    = barsService;
            this.cacheProvider  = cacheProvider;
            this.serverProvider = serverProvider;
            this.pathProvider   = pathProvider;
        }
コード例 #6
0
        public BarController(IMappingService mappingService,
                             IBarsService barsService,
                             IReviewsService reviewsService,
                             IRatingService ratingService,
                             IUserProvider userProvider)
        {
            if (mappingService == null)
            {
                throw new ArgumentNullException("Mapping service cannot be null.");
            }

            if (barsService == null)
            {
                throw new ArgumentNullException("Bars service cannot be null.");
            }

            if (reviewsService == null)
            {
                throw new ArgumentNullException("Reviews service cannot be null.");
            }

            if (ratingService == null)
            {
                throw new ArgumentNullException("Rating service cannot be null.");
            }

            if (userProvider == null)
            {
                throw new ArgumentNullException("User provider cannot be null.");
            }

            this.mappingService = mappingService;
            this.barsService    = barsService;
            this.reviewsService = reviewsService;
            this.ratingService  = ratingService;
            this.userProvider   = userProvider;
        }