コード例 #1
0
        public async Task <IActionResult> Add()
        {
            ViewData["Title"]    = _localizer["PageTitleAdd"];
            ViewData["PageDesc"] = _localizer["PageDescAdd"];

            var batchTempQuery = _journalQueryFactory.CreateBatchTempUOMQuery();
            var uomTempList    = await batchTempQuery.ExecuteAsync().ConfigureAwait(false);

            var batchSugarQuery = _journalQueryFactory.CreateBatchSugarUOMQuery();
            var uomSugarList    = await batchSugarQuery.ExecuteAsync().ConfigureAwait(false);

            var batchVolumeQuery = _journalQueryFactory.CreateBatchVolumeUOMQuery();
            var uomVolumeList    = await batchVolumeQuery.ExecuteAsync().ConfigureAwait(false);

            var getCategoriesQuery = _recipeQueryFactory.CreateCategoriesQuery();
            var cList = await getCategoriesQuery.ExecuteAsync().ConfigureAwait(false);

            var varietiesQuery = _recipeQueryFactory.CreateVarietiesQuery();
            var vList          = await varietiesQuery.ExecuteAsync().ConfigureAwait(false);

            var getYeastQuery = _yeastQueryFactory.CreateYeastsQuery();
            var yList         = await getYeastQuery.ExecuteAsync().ConfigureAwait(false);

            var addBatchModel = _modelFactory.CreateBatchViewModel(null, null, vList, cList, yList, null, uomVolumeList, uomSugarList, uomTempList);

            // validate with User (ApplicationUser)
            var appUser = await UserManagerAgent.GetUserAsync(User).ConfigureAwait(false);

            addBatchModel.BatchJwt = await CreateJwtTokenAsync(appUser, 15).ConfigureAwait(false);

            return(View(addBatchModel));
        }
コード例 #2
0
        public Factory(Business.Recipe.Queries.IFactory recipeQueryFactory, Business.Yeast.Queries.IFactory yeastQueryFactory,
                       Business.MaloCulture.Queries.IFactory maloQueryFactory, Business.Journal.Queries.IFactory journalQueryFactory)
        {
            _recipeQueryFactory  = recipeQueryFactory ?? throw new ArgumentNullException(nameof(recipeQueryFactory));
            _yeastQueryFactory   = yeastQueryFactory ?? throw new ArgumentNullException(nameof(yeastQueryFactory));
            _journalQueryFactory = journalQueryFactory ?? throw new ArgumentNullException(nameof(journalQueryFactory));
            _maloQueryFactory    = maloQueryFactory ?? throw new ArgumentNullException(nameof(maloQueryFactory));

            _getCategoriesQuery  = _recipeQueryFactory.CreateCategoriesQuery();
            _getVarietiesQuery   = _recipeQueryFactory.CreateVarietiesQuery();
            _getYeastsQuery      = _yeastQueryFactory.CreateYeastsQuery();
            _getYeastPairsQuery  = _yeastQueryFactory.CreateYeastPairQuery();
            _getYeastBrandsQuery = _yeastQueryFactory.CreateBrandsQuery();
            _getYeastStylesQuery = _yeastQueryFactory.CreateStylesQuery();
            _getMaloQuery        = _maloQueryFactory.CreateMaloCulturesQuery();
            _getMaloBrandsQuery  = _maloQueryFactory.CreateBrandsQuery();
            _getMaloStylesQuery  = _maloQueryFactory.CreateStylesQuery();
            _getSugarUOMQuery    = _journalQueryFactory.CreateBatchSugarUOMQuery();
            _getTempUOMQuery     = _journalQueryFactory.CreateBatchTempUOMQuery();
            _getVolumeUOMQuery   = _journalQueryFactory.CreateBatchVolumeUOMQuery();

            _categoriesDtoList    = _getCategoriesQuery.Execute();
            _varietiesDtoList     = _getVarietiesQuery.Execute();
            _yeastsDtoList        = _getYeastsQuery.Execute();
            _yeastPairingsDtoList = _getYeastPairsQuery.Execute();
            _yeastBrandsDtoList   = _getYeastBrandsQuery.Execute();
            _yeastStylesDtoList   = _getMaloStylesQuery.Execute();

            _maloDtoList       = _getMaloQuery.Execute();
            _maloBrandsDtoList = _getMaloBrandsQuery.Execute();
            _maloStylesDtoList = _getYeastStylesQuery.Execute();

            _getSugarUomList  = _getSugarUOMQuery.Execute();
            _getTempUomList   = _getTempUOMQuery.Execute();
            _getVolumeUomList = _getVolumeUOMQuery.Execute();
        }