Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
IngvarKofoed committed Dec 7, 2011
1 parent cd88f6e commit 24851b3
Showing 1 changed file with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,31 @@ internal static string GenerateTableName(DataTypeDescriptor dataTypeDescriptor,
throw new InvalidOperationException("Unsupported data scope identifier: '{0}'".FormatWith(dataScope.Name));
}

string result = string.Format("{0}_{1}_{2}", tableNameStem, dataTypeDescriptor.Name, publicationScope);
string storageKey = GetStorageName(publicationScope.ToString(), cultureInfo.Name);

if (!string.IsNullOrEmpty(cultureInfo.ToString())) result += "_" + cultureInfo.ToString().Replace("-", "");
return string.Format("{0}_{1}_{2}", tableNameStem, dataTypeDescriptor.Name, storageKey);

return result;
#warning MRJ: BM: Clean this
//string result = string.Format("{0}_{1}_{2}", tableNameStem, dataTypeDescriptor.Name, publicationScope);

//if (!string.IsNullOrEmpty(cultureInfo.ToString())) result += "_" + cultureInfo;

//return result;
}


internal static string GetStorageName(string dataScope, string cultureName)
{
string result = dataScope;
if (!cultureName.IsNullOrEmpty())
{
result += "_" + cultureName.Replace('-', '_').Replace(' ', '_');
}
return result;
}



internal static string GenerateListTableName(DataTypeDescriptor typeDescriptor, DataFieldDescriptor fieldDescriptor)
{
return string.Format("{0}_{1}", GenerateTableName(typeDescriptor), fieldDescriptor.Name);
Expand Down

0 comments on commit 24851b3

Please sign in to comment.