示例#1
0
        /// <summary>
        /// Добавляет набор заданий
        /// </summary>
        /// <param name="lmsTaskSet"></param>
        /// <returns></returns>
        public async Task AddLmsTaskSet(LmsTaskSet lmsTaskSet)
        {
            if (lmsTaskSet == null)
            {
                return;
            }

            _context.LmsTaskSets.Add(lmsTaskSet);
            await _context.SaveChangesAsync();
        }
示例#2
0
        /// <summary>
        /// Удаление сущности "Набор заданий" и привязок "Набор заданий" - "Задание"
        /// </summary>
        /// <param name="lmsTaskSet"></param>
        /// <returns></returns>
        public async Task RemoveLmsTaskSet(LmsTaskSet lmsTaskSet)
        {
            if (lmsTaskSet == null)
            {
                return;
            }

            var entry = await GetLmsTaskSetAsync(lmsTaskSet.LmsTaskSetId);

            if (entry == null)
            {
                return;
            }

            _context.LmsTaskSets.Remove(entry);

            await _context.SaveChangesAsync();
        }
示例#3
0
        /// <summary>
        /// Обновление сущности "Набор заданий"
        /// </summary>
        /// <param name="lmsTaskSet"></param>
        /// <returns></returns>
        public async Task UpdateLmsTaskSet(LmsTaskSet lmsTaskSet)
        {
            if (lmsTaskSet == null)
            {
                return;
            }

            var entry = await GetLmsTaskSetAsync(lmsTaskSet.LmsTaskSetId);

            if (entry == null)
            {
                return;
            }

            if (entry.LmsTaskSetDescription != lmsTaskSet.LmsTaskSetDescription)
            {
                entry.LmsTaskSetDescription = lmsTaskSet.LmsTaskSetDescription;
            }

            await _context.SaveChangesAsync();
        }