Skip to content

Commit 37b32f4

Browse files
committed
- added RecordNotFoundException
1 parent 99016cd commit 37b32f4

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

Shuttle.Core.Data/RecordNotFoundException.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ public RecordNotFoundException(string message) : base(message)
1010

1111
public static RecordNotFoundException For(string name, object id)
1212
{
13-
return new RecordNotFoundException(
14-
$"Could not find a record for '{name}' with id '{id ?? "(null)"}'.");
13+
return new RecordNotFoundException(string.Format(Resources.RecordNotFoundException, name ?? "(unknown)", id ?? "(null)"));
1514
}
1615

1716
public static RecordNotFoundException For<T>(object id)

Shuttle.Core.Data/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Shuttle.Core.Data/Resources.resx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,4 +193,8 @@
193193
<value>The required connection string with name '{0}' is not specified in the application configuration file.</value>
194194
<comment>{0} = connection string name</comment>
195195
</data>
196+
<data name="RecordNotFoundException" xml:space="preserve">
197+
<value>Could not find a record for '{0}' with id '{1}'.</value>
198+
<comment>{0} = entity name, {1} = id/key</comment>
199+
</data>
196200
</root>

0 commit comments

Comments
 (0)