Example #1
0
        public async Task <string> AddAsync(ScheduleLesson lesson)
        {
            ThrowIfNotValidate(lesson);
            await ThrowIdCantInsertAsync(lesson);

            var id = Guid.NewGuid().ToString();

            lesson.Id = id;
            _context.Add(lesson);
            await _context.SaveChangesAsync();

            return(id);
        }
Example #2
0
 public void AddScheduledTask(ScheduledTask task)
 {
     _context.Add(task);
     _context.SaveChanges();
 }
Example #3
0
        public virtual void Add(T entity)
        {
            EntityEntry dbEntityEntry = _context.Entry <T>(entity);

            _context.Add(dbEntityEntry);
        }