public void ShouldLogAtDebugLevel()
        {
            //arrange 
            var logger = new ConsoleOutLogger("Testing", LogLevel.Trace, true, true, true, string.Empty);
            var target = new DataContext(Settings.Default.Connection, new DriversEducationMappings(), logger);

            //act
            var firstDriver = new Driver("Devlin", "Liles");
            target.Add(firstDriver);
            target.Add(new Driver("Tim", "Rayburn"));
            target.Add(new Driver("Jay", "Smith"));
            target.Add(new Driver("Brian", "Sullivan"));
            target.Add(new Driver("Cori", "Drew"));

            target.Commit();

            target.Reload(firstDriver);

            foreach (var driver in target.AsQueryable<Driver>())
            {
                target.Remove(driver);
            }


            target.Commit();

            target.ExecuteSqlQuery<Driver>("Select * from Drivers Where LastName = @lastName",
                new DbParameter[] {new SqlParameter("lastName", "Liles")});

            //assert
            //Assert.Inconclusive("We fail here to get the output from console nice and easy");
        }
Example #2
0
 public void Delete <T>(T entity) where T : class
 {
     _context.Remove(entity);
 }
 public void Delete(Product product)
 {
     _context.Remove(product);
     _context.SaveChanges();
 }
Example #4
0
 public void Remove(TEntity entity)
 {
     _context.Remove(entity);
 }
        public async Task <bool> Delete <T>(T entity) where T : class
        {
            _context.Remove(entity);

            return(await _context.SaveChangesAsync() > 0);
        }
 public void Remove(Audit audit)
 {
     context.Remove(audit);
 }
Example #7
0
 public async Task Delete(T entity)
 {
     _context.Remove(entity);
     //_context.SaveChanges();
 }
Example #8
0
 public void DeleteEntity(MeterReading model)
 {
     _context.Remove(model);
     //_context.SaveChanges();
 }
Example #9
0
 public void Delete(T entity)
 {
     _context.Remove(entity); _context.SaveChanges();
 }
Example #10
0
        public void Delete(int id)
        {
            var Post = _context.Posts.Find(id);

            _context.Remove(Post);
        }
Example #11
0
 public async Task Delete(Product product)
 {
     _context.Remove(product);
     await _context.SaveChangesAsync();
 }
 public void Delete <T>(T entity) where T : class
 {
     data.Remove(entity);
 }
 public Student Delete(Student student)
 {
     _context.Remove(student);
     return(student);
 }
Example #14
0
 public bool Delete(T entity)
 {
     _dataContext.Remove(entity);
     return(_dataContext.SaveChanges() > 1);
 }
Example #15
0
 public void Remove(Video video)
 {
     _context.Remove(video);
 }