public void Can_get_data_from_TableWithNamigStrategy_with_GetById()
		{
			OrmLite.OrmLiteConfig.DialectProvider.NamingStrategy =
				OrmLite.OrmLiteConfig.DialectProvider.NamingStrategy = new PrefixNamingStrategy
					                                                       {
						                                                       TablePrefix = "tab_",
						                                                       ColumnPrefix = "col_",
					                                                       };

			using (var db = OpenDbConnection())
			{
				db.CreateTable<ModelWithOnlyStringFields>(true);
				ModelWithOnlyStringFields m = new ModelWithOnlyStringFields()
					                              {
						                              Id = "999",
						                              AlbumId = "112",
						                              AlbumName = "ElectroShip",
						                              Name = "MyNameIsBatman"
					                              };

				db.Save<ModelWithOnlyStringFields>(m);
				var modelFromDb = db.GetById<ModelWithOnlyStringFields>("999");

				Assert.AreEqual(m.Name, modelFromDb.Name);
			}

			OrmLite.OrmLiteConfig.DialectProvider.NamingStrategy = new OrmLiteNamingStrategyBase();
		}
		public void Can_select_with_filter_from_ModelWithOnlyStringFields_table()
		{
			using (var db = OpenDbConnection())
			{
				db.DropAndCreateTable<ModelWithOnlyStringFields>();

				var rowIds = new List<string>(new[] {"id-1", "id-2", "id-3"});

				rowIds.ForEach(x => db.Insert(ModelWithOnlyStringFields.Create(x)));

				var filterRow = ModelWithOnlyStringFields.Create("id-4");
				filterRow.AlbumName = "FilteredName";

				db.Insert(filterRow);

				var rows = db.Where<ModelWithOnlyStringFields>(new {filterRow.AlbumName});
				var dbRowIds = rows.ConvertAll(x => x.Id);
				Assert.That(dbRowIds, Has.Count.EqualTo(1));
				Assert.That(dbRowIds[0], Is.EqualTo(filterRow.Id));

				rows = db.Where<ModelWithOnlyStringFields>(new {filterRow.AlbumName});
				dbRowIds = rows.ConvertAll(x => x.Id);
				Assert.That(dbRowIds, Has.Count.EqualTo(1));
				Assert.That(dbRowIds[0], Is.EqualTo(filterRow.Id));

				var queryByExample = new ModelWithOnlyStringFields {AlbumName = filterRow.AlbumName};
				rows = db.ByExampleWhere<ModelWithOnlyStringFields>(queryByExample);
				dbRowIds = rows.ConvertAll(x => x.Id);
				Assert.That(dbRowIds, Has.Count.EqualTo(1));
				Assert.That(dbRowIds[0], Is.EqualTo(filterRow.Id));

				rows = db.Query<ModelWithOnlyStringFields>(
					"SELECT * FROM ModelWithOnlyStringFields WHERE AlbumName = @AlbumName", new {filterRow.AlbumName});
				dbRowIds = rows.ConvertAll(x => x.Id);
				Assert.That(dbRowIds, Has.Count.EqualTo(1));
				Assert.That(dbRowIds[0], Is.EqualTo(filterRow.Id));
			}
		}
		public void Can_get_data_from_TableWithNamigStrategy_with_query_by_example()
		{
			OrmLite.OrmLiteConfig.DialectProvider.NamingStrategy =
				OrmLite.OrmLiteConfig.DialectProvider.NamingStrategy = new PrefixNamingStrategy
					                                                       {
						                                                       TablePrefix = "tab_",
						                                                       ColumnPrefix = "col_",
					                                                       };

			using (var db = OpenDbConnection())
			{
				db.CreateTable<ModelWithOnlyStringFields>(true);
				ModelWithOnlyStringFields m = new ModelWithOnlyStringFields()
					                              {
						                              Id = "998",
						                              AlbumId = "112",
						                              AlbumName = "ElectroShip",
						                              Name = "QueryByExample"
					                              };

				db.Save<ModelWithOnlyStringFields>(m);
				var modelFromDb = db.Where<ModelWithOnlyStringFields>(new {Name = "QueryByExample"})[0];

				Assert.AreEqual(m.Name, modelFromDb.Name);
			}

			OrmLite.OrmLiteConfig.DialectProvider.NamingStrategy = new OrmLiteNamingStrategyBase();
		}
		public void Can_get_data_from_TableWithUnderscoreSeparatedCompoundNamingStrategy_with_ReadConnectionExtension()
		{
			OrmLiteConfig.DialectProvider.NamingStrategy = new UnderscoreSeparatedCompoundNamingStrategy();

			using (var db = OpenDbConnection())
			{
				db.CreateTable<ModelWithOnlyStringFields>(true);
				var m = new ModelWithOnlyStringFields
					        {
						        Id = "997",
						        AlbumId = "112",
						        AlbumName = "ElectroShip",
						        Name = "ReadConnectionExtensionFirst"
					        };
				db.Save(m);
				var modelFromDb = db.First<ModelWithOnlyStringFields>(x => x.Name == "ReadConnectionExtensionFirst");
				Assert.AreEqual(m.AlbumName, modelFromDb.AlbumName);
			}

			OrmLiteConfig.DialectProvider.NamingStrategy = new OrmLiteNamingStrategyBase();
		}