Esempio n. 1
0
        private InsertStatement(object item, string table)
        {
            var template = InsertStatementTemplate.For(item.GetType(), table);

            CommandText = template.CommandText;
            Parameters  = template.CreateParametersFor(item).ToList();
        }
        public static InsertStatementTemplate For(Type type, string table)
        {
            var key = new TypeAndTable(type, table);

            if (!Statements.ContainsKey(key))
            {
                Statements[key] = new InsertStatementTemplate(key);
            }
            return(Statements[key]);
        }