Esempio n. 1
0
        public static void RemoveBy(this DbStatistics dbSet, Func <Statistic, bool> selector)
        {
            var set = dbSet.ToArray();

            foreach (var entity in set)
            {
                if (selector(entity))
                {
                    dbSet.Remove(entity);
                }
            }
        }
Esempio n. 2
0
        public void TestMethod3()
        {
            Seed(10);

            _db     = new SchoolDbContext4(Effort.DbConnectionFactory.CreatePersistent("1"));
            dbStats = new LINQ_EntityFramework.DbStatistics(_db);
            // number of cars per person: Last Name, Cars Per Person

            var carsPerPerson = dbStats.CarsPerPerson;

            carsPerPerson.Count().Should().BeGreaterOrEqualTo(10);

            carsPerPerson.Last().Item2.Should().BeGreaterOrEqualTo(9);
        }
Esempio n. 3
0
 public void Init()
 {
     // in memory database - -isolated instances of the db
     _db     = new SchoolDbContext4(Effort.DbConnectionFactory.CreatePersistent("1"));
     dbStats = new LINQ_EntityFramework.DbStatistics(_db);
 }