Beispiel #1
0
        public async Task <ActionResult <Limit> > PostLimit(LimitToCreate limitToCreate)
        {
            System.Diagnostics.Debug.WriteLine($"PostLimit: Name: {limitToCreate.Name}, Consecutive Learning Days: {limitToCreate.LimitOfConsecutiveLearningDays}, Learning Days Per Month: {limitToCreate.LimitOfLearningDaysPerMonth}, Learning Days Per Quarter: {limitToCreate.LimitOfLearningDaysPerQuarter}, Learning Days Per Year: {limitToCreate.LimitOfLearningDaysPerYear}");
            var newLimit = await _limitService.AddNewLimitAsync(limitToCreate);

            return(CreatedAtAction(nameof(GetLimit), new { id = newLimit.Id }, newLimit));
        }
Beispiel #2
0
        public async Task <Limit> AddNewLimitAsync(LimitToCreate limitData)
        {
            Limit newLimit = limitData.CreateLimit();

            await _schedulearnContext.Limits.AddAsync(newLimit);

            await _schedulearnContext.SaveChangesAsync();

            return(newLimit);
        }