private void AppendInsertCommand(List <DbParameter> commandParameters, StringBuilder commandTextBuilder, IEntity entity, IPersistenceStorageObjectMapper mapper) { var parameters = mapper.GetParameters(entity); InitializeAndAppendParameters(commandParameters, parameters); AppendInsertCommandTextForType(parameters, mapper.GetTableName(), commandTextBuilder); }
private void AppendUpdateCommand(List <DbParameter> commandParameters, StringBuilder commandTextBuilder, IEntity entity, IPersistenceStorageObjectMapper mapper) { var parameters = mapper.GetParameters(entity); InitializeAndAppendParameters(commandParameters, parameters); if (parameters.Length > 1) // If entity has other properties besides ID. { AppendUpdateCommandTextForType(parameters, mapper.GetTableName(), commandTextBuilder); } else { AppendEmptyUpdateCommandTextForType(parameters, mapper.GetTableName(), commandTextBuilder); } }