Skip to content
This repository was archived by the owner on Feb 29, 2020. It is now read-only.

Commit 58c5a44

Browse files
committed
Remove localization in SQLiteStore
1 parent d797c47 commit 58c5a44

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.SQLiteStore/MobileServiceSQLiteStore.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public override void DefineTable(string tableName, JObject item)
6464

6565
if (this.Initialized)
6666
{
67-
throw new InvalidOperationException(Properties.Resources.SQLiteStore_DefineAfterInitialize);
67+
throw new InvalidOperationException("Cannot define a table after the store has been initialized.");
6868
}
6969

7070
// add id if it is not defined
@@ -168,7 +168,7 @@ private Task UpsertAsyncInternal(string tableName, IEnumerable<JObject> items, b
168168
// otherwise, throw to alert the caller that they have passed an invalid column
169169
if (!table.TryGetValue(prop.Name, out column) && !ignoreMissingColumns)
170170
{
171-
throw new InvalidOperationException(string.Format(Properties.Resources.SQLiteStore_ColumnNotDefined, prop.Name, tableName));
171+
throw new InvalidOperationException(string.Format("Column with name '{0}' is not defined on the local table '{1}'.", prop.Name, tableName));
172172
}
173173

174174
if (column != null)
@@ -289,7 +289,7 @@ private TableDefinition GetTable(string tableName)
289289
TableDefinition table;
290290
if (!this.tableMap.TryGetValue(tableName, out table))
291291
{
292-
throw new InvalidOperationException(string.Format(Properties.Resources.SQLiteStore_TableNotDefined, tableName));
292+
throw new InvalidOperationException(string.Format("Table with name '{0}' is not defined.", tableName));
293293
}
294294
return table;
295295
}
@@ -409,7 +409,7 @@ private static int ValidateParameterCount(int parametersCount)
409409
int batchSize = MaxParametersPerQuery / parametersCount;
410410
if (batchSize == 0)
411411
{
412-
throw new InvalidOperationException(string.Format(Properties.Resources.SQLiteStore_TooManyColumns, MaxParametersPerQuery));
412+
throw new InvalidOperationException(string.Format("The number of fields per entity in an upsert operation is limited to {0}.", MaxParametersPerQuery));
413413
}
414414
return batchSize;
415415
}
@@ -541,7 +541,7 @@ private static void ValidateResult(SQLiteResult result)
541541
{
542542
if (result != SQLiteResult.DONE)
543543
{
544-
throw new SQLiteException(string.Format(Properties.Resources.SQLiteStore_QueryExecutionFailed, result));
544+
throw new SQLiteException(string.Format("Query execution failed with result: '{0}'.", result));
545545
}
546546
}
547547

sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.SQLiteStore/MobileServiceSQLiteStoreExtensions.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ public static void DefineTable<T>(this MobileServiceSQLiteStore store, MobileSer
3131
var contract = settings.ContractResolver.ResolveContract(typeof(T)) as JsonObjectContract;
3232
if (contract == null)
3333
{
34-
throw new ArgumentException(Properties.Resources.SQLiteStore_DefineTableTNotAnObject);
34+
throw new ArgumentException("The generic type T is not an object.");
3535
}
3636
if (contract.DefaultCreator == null)
3737
{
38-
throw new ArgumentException(Properties.Resources.SQLiteStore_DefineTableEmptyCtorNotDefined);
38+
throw new ArgumentException("The generic type T does not have parameterless constructor.");
3939
}
4040

4141
// create an empty object

sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.SQLiteStore/SqlHelpers.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static string GetStoreCastType(Type type)
9898
return SqlColumnType.Text;
9999
}
100100

101-
throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, WindowsAzure.MobileServices.SQLiteStore.Properties.Resources.SQLiteStore_ValueTypeNotSupported, type.Name));
101+
throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, "Value of type '{0}' is not supported.", type.Name));
102102
}
103103

104104
public static string GetStoreType(JTokenType type, bool allowNull)
@@ -131,15 +131,15 @@ public static string GetStoreType(JTokenType type, bool allowNull)
131131
{
132132
return null;
133133
}
134-
throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, WindowsAzure.MobileServices.SQLiteStore.Properties.Resources.SQLiteStore_JTokenNotSupported, type));
134+
throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, "Property of type '{0}' is not supported.", type));
135135
case JTokenType.Comment:
136136
case JTokenType.Constructor:
137137
case JTokenType.None:
138138
case JTokenType.Property:
139139
case JTokenType.Raw:
140140
case JTokenType.Undefined:
141141
default:
142-
throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, WindowsAzure.MobileServices.SQLiteStore.Properties.Resources.SQLiteStore_JTokenNotSupported, type));
142+
throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, "Property of type '{0}' is not supported.", type));
143143
}
144144
}
145145

@@ -282,7 +282,7 @@ private static void ValidateIdentifier(string identifier)
282282
{
283283
if (!IsValidIdentifier(identifier))
284284
{
285-
throw new ArgumentException(string.Format(Properties.Resources.SQLiteStore_InvalidIdentifier, identifier), "identifier");
285+
throw new ArgumentException(string.Format("'{0}' is not a valid identifier. Identifiers must be under 128 characters in length, start with a letter or underscore, and can contain only alpha-numeric and underscore characters.", identifier), "identifier");
286286
}
287287
}
288288

0 commit comments

Comments
 (0)