示例#1
0
        public void Can_GetDictionary()
        {
            const int n = 5;

            using (var db = new OrmLiteConnectionFactory(ConnectionString, FirebirdDialect.Provider).Open())
            {
                db.CreateTable <ModelWithIdAndName>(true);
                db.DeleteAll <ModelWithIdAndName>();
                n.Times(x => db.Insert(ModelWithIdAndName.Create(0)));

                var dictionary = db.Dictionary <int, string>("SELECT Id, Name FROM ModelWIN");

                Assert.That(dictionary, Has.Count.EqualTo(5));

                //Console.Write(dictionary.Dump());
            }
        }
		public void Can_GetDictionary()
		{
			const int n = 5;

            using (var db = new OrmLiteConnectionFactory(ConnectionString, FirebirdDialect.Provider).Open())
			{
				db.CreateTable<ModelWithIdAndName>(true);
				db.DeleteAll<ModelWithIdAndName>();
				n.Times(x => db.Insert(ModelWithIdAndName.Create(0)));

				var dictionary = db.Dictionary<int, string>("SELECT Id, Name FROM ModelWIN");

				Assert.That(dictionary, Has.Count.EqualTo(5));

				//Console.Write(dictionary.Dump());
			}
		}