private static SqlCommand SetupSql() { SqlDb.ResetPersons(); var cmd = new SqlCommand("select Id from [IgniteNetBenchmarks].[dbo].Persons where ID > @min and ID < @max", SqlDb.GetOpenConnection()); cmd.Parameters.Add("@min", SqlDbType.Int).Value = SqlDb.IdMin; cmd.Parameters.Add("@max", SqlDbType.Int).Value = SqlDb.IdMax; cmd.Prepare(); return(cmd); }
public static ICache <int, Person> SetupIgnite() { Ignition.StopAll(true); var ignite = Ignition.Start(new IgniteConfiguration { BinaryConfiguration = new BinaryConfiguration(typeof(Person)) }); var cache = ignite.CreateCache <int, Person>(new CacheConfiguration("persons", new QueryEntity(typeof(Person)))); cache.PutAll(SqlDb.GetTestData().ToDictionary(x => x.Id, x => x)); return(cache); }