public DbLocalizedStringSource GetLocalizedStrings(Type resourceSource) { using IDbConnection con = new NpgsqlConnection(connectionString); con.Open(); using IDbTransaction tran = con.BeginTransaction(); string sql = @" SELECT key_name as Key ,ja as Ja ,en as En FROM localization_resource WHERE category = @category ORDER BY key "; var param = new { category = resourceSource.Name }; IEnumerable <LocalizationRecord> records = con.Query <LocalizationRecord>(sql, param, tran); return(DbLocalizedStringSource.FromEnumerable(records)); }
private DbStringLocalizer CreateDbStringLocalizer(Type resourceSource) { DbLocalizedStringSource source = _dbLocalizedStringSourceProvider.GetLocalizedStrings(resourceSource); return(new DbStringLocalizer(source)); }
public DbStringLocalizer(DbLocalizedStringSource dbLocalizedStringSource) { _dbLocalizedStringSource = dbLocalizedStringSource; }