internal async Task<MonthPlanDto> GetMonthPlanDtoAsync(string userId, LanguageType languageType) { MonthPlanDto statisticDto = Redis.GetMonthPlan(userId, languageType); if (statisticDto == null) { MonthPlan monthPlan = await _db.GetThisMonthPlanAsync(userId, languageType); if (monthPlan == null) { int planedCount = CalculateMonthPlan(userId, languageType); monthPlan = await _db.CreateMonthPlanAsync(userId, languageType, planedCount); } statisticDto = new MonthPlanDto(monthPlan); } return statisticDto; }
internal async Task <MonthPlanDto> GetMonthPlanDtoAsync(string userId, LanguageType languageType) { MonthPlanDto statisticDto = Redis.GetMonthPlan(userId, languageType); if (statisticDto == null) { MonthPlan monthPlan = await _db.GetThisMonthPlanAsync(userId, languageType); if (monthPlan == null) { int planedCount = CalculateMonthPlan(userId, languageType); monthPlan = await _db.CreateMonthPlanAsync(userId, languageType, planedCount); } statisticDto = new MonthPlanDto(monthPlan); } return(statisticDto); }