コード例 #1
0
 public YieldController(IYieldService yieldService, IWarehouseService warehouseService, IHttpContextAccessor httpContextAccessor)
 {
     _yieldService        = yieldService;
     _warehouseService    = warehouseService;
     _httpContextAccessor = httpContextAccessor;
     userId = _httpContextAccessor.HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
 }
コード例 #2
0
 public ProductController(ISeedService seedService, IFertilizerService fertilizerService, IYieldService yieldService,
                          IPesticideService pesticideService, IHttpContextAccessor httpContextAccessor)
 {
     _seedService         = seedService;
     _fertilizerService   = fertilizerService;
     _yieldService        = yieldService;
     _pesticideService    = pesticideService;
     _httpContextAccessor = httpContextAccessor;
 }
コード例 #3
0
        private async Task <string> CoroutineBuildString(int i, IYieldService <bool, string, string> yieldService)
        {
            await yieldService.Yield("Building string [" + i + "]");

            string str = "[" + i + "]:" + (char)((int)'A' + i);

            await yieldService.Yield("String built.");

            return(str);
        }
コード例 #4
0
        private async Task<string> CoroutineBuildString(int i, IYieldService<bool, string, string> yieldService)
        {
            await yieldService.Yield("Building string [" + i + "]");

            string str = "[" + i + "]:" + (char)((int)'A' + i);

            await yieldService.Yield("String built.");

            return str;
        }
コード例 #5
0
        private async Task <bool> Coroutine1(IYieldService <bool, string, bool> yieldService)
        {
            foreach (int i in Enumerable.Range(0, 10))
            {
                string si = await yieldService.YieldFrom <string>(y2 => CoroutineBuildString(i, y2));

                await yieldService.Yield("Received completed string: " + si);
            }

            return(true);
        }
コード例 #6
0
        private async Task<bool> Coroutine1(IYieldService<bool, string, bool> yieldService)
        {
            foreach(int i in Enumerable.Range(0, 10))
            {
                string si = await yieldService.YieldFrom<string>(y2 => CoroutineBuildString(i, y2));

                await yieldService.Yield("Received completed string: " + si);
            }

            return true;
        }
コード例 #7
0
 public IncomeRequestHandler(BankDbContext context, IYieldService yieldService)
 {
     _context      = context;
     _yieldService = yieldService;
 }