Example #1
0
        public PlanManager(IPlanRepository planRepository)
        {
            mPlanRepository = planRepository;
            mPlan           = new Plan();

            mPlanRepository.AddPlan(mPlan);
        }
Example #2
0
        public async Task RegisterUsersPlanAsync(Guid userId, int plannedWeight, DateTime targetDate)
        {
            User user = await _userRepository.GetAsync(userId);

            if (user == null)
            {
                return;
            }
            await _planRepository.AddPlan(Plan.Create(userId, plannedWeight, targetDate));
        }