private void WriteTranslationBatch(ITranslationBatch batch) { Insert insert = GetTranslationBatchInsert(batch); ExecuteQuery(insert); OnWriteTranslationBatchEnd(); }
private Insert GetTranslationBatchInsert(ITranslationBatch batch) { Insert translationBatchInsert = new Insert(UserConnection) .Into(TranslationSchemaName); translationBatchInsert.Set(TranslationKeyColumnName, Column.Parameter(batch.Key)); batch.ForEach(translation => { translationBatchInsert.Set(translation.Key, Column.Parameter(translation.Value)); }); return(translationBatchInsert); }
/// <summary> /// Writes translation. /// </summary> /// <param name="key">Resource key.</param> /// <param name="translationColumnName">Translation column name.</param> /// <param name="translationColumnValue">Translation column value.</param> public override void WriteTranslation(string key, string translationColumnName, string translationColumnValue) { ITranslationBatch batch = ForceGetTranslationBatch(key); if (batch.ContainsKey(translationColumnName)) { return; } batch.Add(translationColumnName, translationColumnValue); OnWriteTranslationEnd(); }