Skip to content

Commit 0bd9b2e

Browse files
Made used of the EntityKeyNotFound string resource
1 parent b5fd2bd commit 0bd9b2e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/DotNetToolkit.Repository/RepositoryAsyncBase.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
namespace DotNetToolkit.Repository
22
{
33
using FetchStrategies;
4+
using Properties;
45
using Queries;
56
using Specifications;
67
using System;
78
using System.Collections.Generic;
9+
using System.Globalization;
810
using System.Linq.Expressions;
911
using System.Threading;
1012
using System.Threading.Tasks;
@@ -214,7 +216,7 @@ public abstract class RepositoryAsyncBase<TEntity, TKey> : RepositoryBase<TEntit
214216

215217
var entity = await GetAsync(key, cancellationToken);
216218
if (entity == null)
217-
throw new InvalidOperationException($"No entity found in the repository with the '{key}' key.");
219+
throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resources.EntityKeyNotFound, key));
218220

219221
DeleteItem(entity);
220222
await SaveChangesAsync(cancellationToken);

0 commit comments

Comments
 (0)