Beispiel #1
0
        public void Upsert_Composite()
        {
            var generator = new UpsertGenerator <CompositeIdSample>();

            Console.WriteLine(generator.GetSql());
            Assert.AreEqual("INSERT INTO `composite_id_table`(`Id1`, `Id2`, `SomeValue`, `SomeDate`) VALUES (?p0, ?p1, ?p2, ?p3) ON DUPLICATE KEY UPDATE `SomeValue` = ?p2, `SomeDate` = ?p3;", generator.GetSql());
        }
Beispiel #2
0
        public void Upsert()
        {
            var generator = new UpsertGenerator <SimpleObject>();

            Assert.Throws <UpsertNotSupportedOnAutoGeneratedIdTypesException>(() => generator.GetSql());
        }