public async Task <InstanceDTO> SaveNewInstance(int id, CreateInstance instanceData)
        {
            var instance = new Instance
            {
                GoalId    = id,
                StartTime = instanceData.StartTime,
                EndTime   = instanceData.EndTime,
                Comment   = instanceData.Comment,
            };

            _context.Instance.Add(instance);
            await _context.SaveChangesAsync();

            var newInstance = await GetInstanceById(instance.Id);

            return(newInstance);
        }
        public async Task <GoalDTO> SaveNewGoal(GoalDTO goal)
        {
            var newGoal = new Goal
            {
                Id          = goal.Id,
                Title       = goal.Title,
                UserId      = goal.UserId,
                StartDate   = goal.StartDate,
                EndDate     = goal.EndDate,
                StartValue  = goal.StartValue,
                TargetValue = goal.TargetValue,
                Category    = goal.Category,
                Completed   = goal.Completed,
            };

            _context.Goal.Add(newGoal);
            await _context.SaveChangesAsync();

            return(await GetGoalById(goal.Id));
        }