Skip to content

Commit

Permalink
Remove unnecessary argument in ThrowIfNullOrEmpty (OrchardCMS#15272)
Browse files Browse the repository at this point in the history
Co-authored-by: Hisham Bin Ateya <[email protected]>
  • Loading branch information
2 people authored and urbanit committed Mar 18, 2024
1 parent 4d7bc63 commit de26a04
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ElasticsearchIndexPermissionHelper

public static Permission GetElasticIndexPermission(string indexName)
{
ArgumentException.ThrowIfNullOrEmpty(indexName, nameof(indexName));
ArgumentException.ThrowIfNullOrEmpty(indexName);

if (!_permissions.TryGetValue(indexName, out var permission))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static bool TryGet<TPart>(this ContentItem contentItem, out TPart part) w
/// <returns>true if a part found, otherwise false.</returns>
public static bool TryGet<TPart>(this ContentItem contentItem, string name, out TPart part) where TPart : ContentPart
{
ArgumentException.ThrowIfNullOrEmpty(name, nameof(name));
ArgumentException.ThrowIfNullOrEmpty(name);

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public async Task<IEnumerable<ContentPartDefinition>> ListPartDefinitionsAsync()

public async Task<ContentTypeDefinition> LoadTypeDefinitionAsync(string name)
{
ArgumentException.ThrowIfNullOrEmpty(name, nameof(name));
ArgumentException.ThrowIfNullOrEmpty(name);

if (_scopedTypeDefinitions.TryGetValue(name, out var typeDefinition))
{
Expand All @@ -84,7 +84,7 @@ public async Task<ContentTypeDefinition> LoadTypeDefinitionAsync(string name)

public async Task<ContentTypeDefinition> GetTypeDefinitionAsync(string name)
{
ArgumentException.ThrowIfNullOrEmpty(name, nameof(name));
ArgumentException.ThrowIfNullOrEmpty(name);

var document = await _contentDefinitionStore.GetContentDefinitionAsync();

Expand All @@ -95,7 +95,7 @@ public async Task<ContentTypeDefinition> GetTypeDefinitionAsync(string name)

public async Task<ContentPartDefinition> LoadPartDefinitionAsync(string name)
{
ArgumentException.ThrowIfNullOrEmpty(name, nameof(name));
ArgumentException.ThrowIfNullOrEmpty(name);

if (_scopedPartDefinitions.TryGetValue(name, out var partDefinition))
{
Expand All @@ -109,7 +109,7 @@ public async Task<ContentPartDefinition> LoadPartDefinitionAsync(string name)

public async Task<ContentPartDefinition> GetPartDefinitionAsync(string name)
{
ArgumentException.ThrowIfNullOrEmpty(name, nameof(name));
ArgumentException.ThrowIfNullOrEmpty(name);

var document = await _contentDefinitionStore.GetContentDefinitionAsync();

Expand All @@ -120,7 +120,7 @@ public async Task<ContentPartDefinition> GetPartDefinitionAsync(string name)

public async Task DeleteTypeDefinitionAsync(string name)
{
ArgumentException.ThrowIfNullOrEmpty(name, nameof(name));
ArgumentException.ThrowIfNullOrEmpty(name);

var document = await _contentDefinitionStore.LoadContentDefinitionAsync();

Expand All @@ -136,7 +136,7 @@ public async Task DeleteTypeDefinitionAsync(string name)

public async Task DeletePartDefinitionAsync(string name)
{
ArgumentException.ThrowIfNullOrEmpty(name, nameof(name));
ArgumentException.ThrowIfNullOrEmpty(name);

var document = await _contentDefinitionStore.LoadContentDefinitionAsync();

Expand Down
4 changes: 2 additions & 2 deletions src/OrchardCore/OrchardCore.Data.YesSql/SqliteHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public static string GetConnectionString(SqliteOptions sqliteOptions, string dat
/// <returns></returns>
public static string GetConnectionString(SqliteOptions sqliteOptions, string databaseFolder, string databaseName, SqliteOpenMode sqliteOpenMode)
{
ArgumentException.ThrowIfNullOrEmpty(databaseFolder, nameof(databaseFolder));
ArgumentException.ThrowIfNullOrEmpty(databaseName, nameof(databaseName));
ArgumentException.ThrowIfNullOrEmpty(databaseFolder);
ArgumentException.ThrowIfNullOrEmpty(databaseName);

return GetSqliteConnectionStringBuilder(sqliteOptions, databaseFolder, databaseName, sqliteOpenMode).ToString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public ShapeViewModel()

public ShapeViewModel(string shapeType)
{
ArgumentException.ThrowIfNullOrEmpty(shapeType, nameof(shapeType));
ArgumentException.ThrowIfNullOrEmpty(shapeType);

Metadata.Type = shapeType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public AzureAISearchIndexMap()

public AzureAISearchIndexMap(string azureFieldKey, Types type)
{
ArgumentException.ThrowIfNullOrEmpty(azureFieldKey, nameof(azureFieldKey));
ArgumentException.ThrowIfNullOrEmpty(azureFieldKey);

AzureFieldKey = azureFieldKey;
Type = type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public class AzureAIIndexDocumentManager(

public async Task<IEnumerable<SearchDocument>> SearchAsync(string indexName, string searchText, SearchOptions searchOptions = null)
{
ArgumentException.ThrowIfNullOrEmpty(indexName, nameof(indexName));
ArgumentException.ThrowIfNullOrWhiteSpace(searchText, nameof(searchText));
ArgumentException.ThrowIfNullOrEmpty(indexName);
ArgumentException.ThrowIfNullOrWhiteSpace(searchText);

var client = GetSearchClient(indexName);

Expand Down

0 comments on commit de26a04

Please sign in to comment.