Пример #1
0
        public void TestInsert()
        {
            var dapper   = new DapperObject <Person>();
            var instance = GetRandomPerson();
            var insert   = dapper.Insert(instance);

            Assert.AreEqual(insert,
                            $"INSERT INTO PESSOA (ID, NAME, AGE) VALUES ({instance.Id}, '{instance.Name}', {instance.Age})");
        }
Пример #2
0
        public static string GetInsertSql <T>(this T model, DapperObjectOptions options = null)
        {
            var dapperObject = new DapperObject <T>(options);

            return(dapperObject.Insert(model));
        }