Пример #1
0
        private IEnumerable <T> Insert <T>(IEnumerable <T> entities, Model.InsertStatementModel <T> model) where T : ITable
        {
            var command = _connection.CreateCommand();

            foreach (var entity in entities)
            {
                command.CommandText = model.ApplyParameters(entity);
                _connector.PreInsert <T>(command, entity);
                command.ExecuteScalar();
                _connector.PostInsert <T>(command, entity);
            }
            return(entities);
        }