Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary argument in ThrowIfNullOrEmpty #15272

Merged
merged 3 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading