public void Insert <T>(IEnumerable <T> entities) { var entityList = entities.ToList(); if (_conventionReader.HasIdentityId(typeof(T))) { var commands = CreateIdentityInsertCommands(entities); var ids = _dbCommandExecutor.ExecuteScalarList <int>(commands, ConnectionString); for (int i = 0; i < ids.Count; i++) { _conventionReader.SetId(entityList[i], ids[i]); } } else { var commands = CreateInsertCommands(entities); _dbCommandExecutor.ExecuteNonQuery(commands, ConnectionString); } }
public IList <TScalar> FindScalarList <T, TScalar>(SqlQuery sqlQuery) { var command = CreateCommand(sqlQuery); return(_dbCommandExecutor.ExecuteScalarList <TScalar>(command, ConnectionString)); }
public IList <TScalar> ExecuteScalarList <TScalar>() { return(_dbCommandExecutor.ExecuteScalarList <TScalar>(Command, ConnectionString)); }