Skip to content

Commit 11a46d5

Browse files
committed
refactor: Removed unused checks
1 parent 116fd3f commit 11a46d5

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

docs/Media/Readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ The following settings in `appsettings.json` control media upload functionality:
2222
| ------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------- |
2323
| ImageStorageProvider | string | Currently only supports `Azure` for Azure Blob Storage. |
2424
| AuthenticationMode | string | Authentication method - either `Default` for Microsoft Entra ID or `ConnectionString` for connection string auth |
25-
| ConnectionString | string | Azure Storage connection string (only used when AuthenticationMode is `ConnectionString`) |
26-
| ServiceUrl | string | Azure Blob Storage service URL (only used when AuthenticationMode is `Default`) |
25+
| ConnectionString | string | Azure Storage connection string (only used and mandatory when AuthenticationMode is `ConnectionString`) |
26+
| ServiceUrl | string | Azure Blob Storage service URL (only used and mandatory when AuthenticationMode is `Default`) |
2727
| ContainerName | string | Name of the Azure Storage container to store uploaded files. |
2828
| CdnEndpoint | string | Optional CDN endpoint to use for uploaded images. If set, the blog will return this URL instead of the storage account URL for uploaded assets. |
2929

src/LinkDotNet.Blog.Infrastructure/Persistence/CachedRepository.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public async ValueTask StoreAsync(T entity)
5151

5252
await repository.StoreAsync(entity);
5353

54-
if (!string.IsNullOrEmpty(entity.Id) && memoryCache.TryGetValue(entity.Id, out _))
54+
if (!string.IsNullOrEmpty(entity.Id))
5555
{
5656
memoryCache.Remove(entity.Id);
5757
}
@@ -60,11 +60,7 @@ public async ValueTask StoreAsync(T entity)
6060
public async ValueTask DeleteAsync(string id)
6161
{
6262
await repository.DeleteAsync(id);
63-
64-
if (memoryCache.TryGetValue(id, out _))
65-
{
66-
memoryCache.Remove(id);
67-
}
63+
memoryCache.Remove(id);
6864
}
6965

7066
public async ValueTask DeleteBulkAsync(IReadOnlyCollection<string> ids) => await repository.DeleteBulkAsync(ids);

0 commit comments

Comments
 (0)