public void Can_DeleteById_from_ModelWithFieldsOfDifferentTypes_table()
		{
			using (var db = new OrmLiteConnectionFactory(ConnectionString, FirebirdDialect.Provider).Open())
			{
				db.CreateTable<ModelWithFieldsOfDifferentTypes>(true);

				var rowIds = new List<int>(new[] {1, 2, 3});
				rowIds.ForEach(x => db.Insert(ModelWithFieldsOfDifferentTypes.Create(x)));

				db.DeleteById<ModelWithFieldsOfDifferentTypes>(2);

				var rows = db.GetByIds<ModelWithFieldsOfDifferentTypes>(rowIds);
				var dbRowIds = rows.ConvertAll(x => x.Id);

				Assert.That(dbRowIds, Is.EquivalentTo(new[] {1, 3}));
			}
		}
示例#2
0
        public void Can_DeleteById_from_ModelWithFieldsOfDifferentTypes_table()
        {
            using (var db = new OrmLiteConnectionFactory(ConnectionString, FirebirdDialect.Provider).Open())
            {
                db.CreateTable <ModelWithFieldsOfDifferentTypes>(true);

                var rowIds = new List <int>(new[] { 1, 2, 3 });
                rowIds.ForEach(x => db.Insert(ModelWithFieldsOfDifferentTypes.Create(x)));

                db.DeleteById <ModelWithFieldsOfDifferentTypes>(2);

                var rows     = db.GetByIds <ModelWithFieldsOfDifferentTypes>(rowIds);
                var dbRowIds = rows.ConvertAll(x => x.Id);

                Assert.That(dbRowIds, Is.EquivalentTo(new[] { 1, 3 }));
            }
        }