Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Remove redundant switch section

supportd4d6a9937791
diff --git a/src/Business/Grand.Business.Authentication/Services/TwoFactorAuthenticationService.cs b/src/Business/Grand.Business.Authentication/Services/TwoFactorAuthenticationService.cs
index ec292324b..12879e629 100644
--- a/src/Business/Grand.Business.Authentication/Services/TwoFactorAuthenticationService.cs
+++ b/src/Business/Grand.Business.Authentication/Services/TwoFactorAuthenticationService.cs
@@ -73,9 +73,6 @@ namespace Grand.Business.Authentication.Services
var smsVerificationService = _serviceProvider.GetRequiredService<ISMSVerificationService>();
model = await smsVerificationService.GenerateCode(secretKey, customer, language);
break;
-
- default:
- break;
}
return model;
}
diff --git a/src/Business/Grand.Business.Catalog/Events/Handlers/DiscountDeletedEventHandler.cs b/src/Business/Grand.Business.Catalog/Events/Handlers/DiscountDeletedEventHandler.cs
index 21d091974..c14bc8691 100644
--- a/src/Business/Grand.Business.Catalog/Events/Handlers/DiscountDeletedEventHandler.cs
+++ b/src/Business/Grand.Business.Catalog/Events/Handlers/DiscountDeletedEventHandler.cs
@@ -88,8 +88,6 @@ namespace Grand.Business.Catalog.Events.Handlers
break;
case DiscountType.AssignedToAllProducts:
break;
- default:
- break;
}
//remove coupon codes
diff --git a/src/Business/Grand.Business.Catalog/Services/ExportImport/ProductSchemaProperty.cs b/src/Business/Grand.Business.Catalog/Services/ExportImport/ProductSchemaProperty.cs
index 05d6cbd62..f35981736 100644
--- a/src/Business/Grand.Business.Catalog/Services/ExportImport/ProductSchemaProperty.cs
+++ b/src/Business/Grand.Business.Catalog/Services/ExportImport/ProductSchemaProperty.cs
@@ -145,8 +145,6 @@ namespace Grand.Business.Catalog.Services.ExportImport
case 2:
picture3 = pictureLocalPath;
break;
- default:
- break;
}
i++;
}
diff --git a/src/Business/Grand.Business.Catalog/Services/Prices/PricingService.cs b/src/Business/Grand.Business.Catalog/Services/Prices/PricingService.cs
index 4dc468bf9..afc0b91de 100644
--- a/src/Business/Grand.Business.Catalog/Services/Prices/PricingService.cs
+++ b/src/Business/Grand.Business.Catalog/Services/Prices/PricingService.cs
@@ -714,8 +714,6 @@ namespace Grand.Business.Catalog.Services.Prices
cost += associatedProduct.ProductCost * attributeValue.Quantity;
}
break;
- default:
- break;
}
}
@@ -753,8 +751,6 @@ namespace Grand.Business.Catalog.Services.Prices
}
}
break;
- default:
- break;
}
return adjustment;
diff --git a/src/Business/Grand.Business.Catalog/Services/Products/InventoryManageService.cs b/src/Business/Grand.Business.Catalog/Services/Products/InventoryManageService.cs
index d614b9b26..26e5e296e 100644
--- a/src/Business/Grand.Business.Catalog/Services/Products/InventoryManageService.cs
+++ b/src/Business/Grand.Business.Catalog/Services/Products/InventoryManageService.cs
@@ -333,8 +333,6 @@ namespace Grand.Business.Catalog.Services.Products
//event notification
await _mediator.EntityUpdated(product);
- break;
- default:
break;
}
}
@@ -377,8 +375,6 @@ namespace Grand.Business.Catalog.Services.Products
//event notification
await _mediator.EntityUpdated(product);
- break;
- default:
break;
}
}
diff --git a/src/Business/Grand.Business.Catalog/Services/Products/StockQuantityService.cs b/src/Business/Grand.Business.Catalog/Services/Products/StockQuantityService.cs
index bb4573f80..2d1485040 100644
--- a/src/Business/Grand.Business.Catalog/Services/Products/StockQuantityService.cs
+++ b/src/Business/Grand.Business.Catalog/Services/Products/StockQuantityService.cs
@@ -118,8 +118,6 @@ namespace Grand.Business.Catalog.Services.Products
case BackorderMode.AllowQtyBelowZero:
stockMessage = _translationService.GetResource("Products.Availability.Backordering");
break;
- default:
- break;
}
}
@@ -157,8 +155,6 @@ namespace Grand.Business.Catalog.Services.Products
case BackorderMode.AllowQtyBelowZero:
stockMessage = _translationService.GetResource("Products.Availability.Attributes.Backordering");
break;
- default:
- break;
}
if (!combination.AllowOutOfStockOrders)
stockMessage = _translationService.GetResource("Products.Availability.Attributes.OutOfStock");
diff --git a/src/Business/Grand.Business.Checkout/Commands/Handlers/Orders/PlaceOrderCommandHandler.cs b/src/Business/Grand.Business.Checkout/Commands/Handlers/Orders/PlaceOrderCommandHandler.cs
index 075897a07..2c4b1dbdc 100644
--- a/src/Business/Grand.Business.Checkout/Commands/Handlers/Orders/PlaceOrderCommandHandler.cs
+++ b/src/Business/Grand.Business.Checkout/Commands/Handlers/Orders/PlaceOrderCommandHandler.cs
@@ -376,8 +376,6 @@ namespace Grand.Business.Checkout.Commands.Handlers.Orders
}
}
break;
- default:
- break;
}
}
}
diff --git a/src/Business/Grand.Business.Checkout/Validators/ShoppingCartCommonWarningsValidator.cs b/src/Business/Grand.Business.Checkout/Validators/ShoppingCartCommonWarningsValidator.cs
index 60718fc57..7f1c73bc8 100644
--- a/src/Business/Grand.Business.Checkout/Validators/ShoppingCartCommonWarningsValidator.cs
+++ b/src/Business/Grand.Business.Checkout/Validators/ShoppingCartCommonWarningsValidator.cs
@@ -41,8 +41,6 @@ namespace Grand.Business.Checkout.Validators
}
}
break;
- default:
- break;
}
switch (value.ShoppingCartType)
diff --git a/src/Business/Grand.Business.Checkout/Validators/ShoppingCartInventoryProductValidator.cs b/src/Business/Grand.Business.Checkout/Validators/ShoppingCartInventoryProductValidator.cs
index 0660eb944..d15ce71d5 100644
--- a/src/Business/Grand.Business.Checkout/Validators/ShoppingCartInventoryProductValidator.cs
+++ b/src/Business/Grand.Business.Checkout/Validators/ShoppingCartInventoryProductValidator.cs
@@ -142,8 +142,6 @@ namespace Grand.Business.Checkout.Validators
}
}
break;
- default:
- break;
}
}
});
diff --git a/src/Business/Grand.Business.Customers/Services/CustomerManagerService.cs b/src/Business/Grand.Business.Customers/Services/CustomerManagerService.cs
index 008fd6126..f03f23f4b 100644
--- a/src/Business/Grand.Business.Customers/Services/CustomerManagerService.cs
+++ b/src/Business/Grand.Business.Customers/Services/CustomerManagerService.cs
@@ -140,8 +140,6 @@ namespace Grand.Business.Customers.Services
request.Customer.PasswordSalt = saltKey;
request.Customer.Password = _encryptionService.CreatePasswordHash(request.Password, saltKey, _customerSettings.HashedPasswordFormat);
break;
- default:
- break;
}
await _customerHistoryPasswordService.InsertCustomerPassword(request.Customer);
@@ -199,8 +197,6 @@ namespace Grand.Business.Customers.Services
customer.Password = _encryptionService.CreatePasswordHash(request.NewPassword, saltKey, _customerSettings.HashedPasswordFormat);
}
break;
- default:
- break;
}
customer.PasswordChangeDateUtc = DateTime.UtcNow;
customer.PasswordFormatId = request.PasswordFormat;
diff --git a/src/Business/Grand.Business.Storage/Services/PictureService.cs b/src/Business/Grand.Business.Storage/Services/PictureService.cs
index 285bceb66..0d17ff381 100644
--- a/src/Business/Grand.Business.Storage/Services/PictureService.cs
+++ b/src/Business/Grand.Business.Storage/Services/PictureService.cs
@@ -94,8 +94,6 @@ namespace Grand.Business.Storage.Services
case "x-icon":
lastPart = "ico";
break;
- default:
- break;
}
return lastPart;
}
diff --git a/src/Core/Grand.Domain/Customers/CustomerExtensions.cs b/src/Core/Grand.Domain/Customers/CustomerExtensions.cs
index d76654db5..328d98919 100644
--- a/src/Core/Grand.Domain/Customers/CustomerExtensions.cs
+++ b/src/Core/Grand.Domain/Customers/CustomerExtensions.cs
@@ -113,8 +113,6 @@ namespace Grand.Domain.Customers
case CustomerNameFormat.FirstName:
result = customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.FirstName);
break;
- default:
- break;
}
return result;
diff --git a/src/Core/Grand.Domain/Data/LiteDb/LiteDBRepository.cs b/src/Core/Grand.Domain/Data/LiteDb/LiteDBRepository.cs
index 152b48525..2076051a3 100644
--- a/src/Core/Grand.Domain/Data/LiteDb/LiteDBRepository.cs
+++ b/src/Core/Grand.Domain/Data/LiteDb/LiteDBRepository.cs
@@ -229,27 +229,8 @@ namespace Grand.Domain.Data.LiteDb
entity[GetName(expression)] = bsonLongValue;
_database.GetCollection(typeof(T).Name).Update(entity);
break;
- default:
- break;
}
- //if (typeof(U) == typeof(int))
- //{
- // var rawValue = Convert.ToInt32(entity[GetName(expression)].RawValue);
- // var inc = Convert.ToInt32(value);
- // var bsonValue = BsonMapper.Global.Serialize<int>(rawValue + inc);
- // entity[GetName(expression)] = bsonValue;
- // _database.GetCollection(typeof(T).Name).Update(entity);
- //}
- //if (typeof(U) == typeof(long))
- //{
- // var rawValue = Convert.ToInt64(entity[GetName(expression)].RawValue);
- // var inc = Convert.ToInt64(value);
- // var bsonValue = BsonMapper.Global.Serialize<long>(rawValue + inc);
- // entity[GetName(expression)] = bsonValue;
- // _database.GetCollection(typeof(T).Name).Update(entity);
- //}
-
return Task.CompletedTask;
}
/// <summary>
diff --git a/src/Core/Grand.Domain/Orders/OrderExtensions.cs b/src/Core/Grand.Domain/Orders/OrderExtensions.cs
index f134f21ae..1730d1782 100644
--- a/src/Core/Grand.Domain/Orders/OrderExtensions.cs
+++ b/src/Core/Grand.Domain/Orders/OrderExtensions.cs
@@ -68,8 +68,6 @@ namespace Grand.Domain.Orders
}
}
break;
- default:
- break;
}
return false;
diff --git a/src/Core/Grand.Infrastructure/Caching/RabbitMq/CacheMessageEventConsumer.cs b/src/Core/Grand.Infrastructure/Caching/RabbitMq/CacheMessageEventConsumer.cs
index da6dd634f..a1e5cb81a 100644
--- a/src/Core/Grand.Infrastructure/Caching/RabbitMq/CacheMessageEventConsumer.cs
+++ b/src/Core/Grand.Infrastructure/Caching/RabbitMq/CacheMessageEventConsumer.cs
@@ -27,8 +27,6 @@ namespace Grand.Infrastructure.Caching.RabbitMq
case (int)MessageEventType.ClearCache:
await _cache.Clear(false);
break;
- default:
- break;
}
}
}
diff --git a/src/Web/Grand.Web.Common/TagHelpers/Admin/Extend/ExpressionMetadataProvider.cs b/src/Web/Grand.Web.Common/TagHelpers/Admin/Extend/ExpressionMetadataProvider.cs
index 96686d54d..175f521f0 100644
--- a/src/Web/Grand.Web.Common/TagHelpers/Admin/Extend/ExpressionMetadataProvider.cs
+++ b/src/Web/Grand.Web.Common/TagHelpers/Admin/Extend/ExpressionMetadataProvider.cs
@@ -68,8 +68,6 @@ namespace Grand.Web.Common.TagHelpers.Admin.Extend
case ExpressionType.Parameter:
// Parameter expression means "model => model", so we delegate to FromModel
return FromModel(viewData, metadataProvider);
- default:
- break;
}
if (!legalExpression)
diff --git a/src/Web/Grand.Web.Common/TagHelpers/ResourcesTagHelper.cs b/src/Web/Grand.Web.Common/TagHelpers/ResourcesTagHelper.cs
index 4174487c9..c633ba430 100644
--- a/src/Web/Grand.Web.Common/TagHelpers/ResourcesTagHelper.cs
+++ b/src/Web/Grand.Web.Common/TagHelpers/ResourcesTagHelper.cs
@@ -44,9 +44,6 @@ namespace Grand.Web.Common.TagHelpers
case ResourceType.TemplateFooter:
_resourceManager.RenderTemplate(output.Content, false);
break;
-
- default:
- break;
}
output.TagName = null;
diff --git a/src/Web/Grand.Web.Common/TagHelpers/ScriptTagHelper.cs b/src/Web/Grand.Web.Common/TagHelpers/ScriptTagHelper.cs
index 1912233ce..ceaf53654 100644
--- a/src/Web/Grand.Web.Common/TagHelpers/ScriptTagHelper.cs
+++ b/src/Web/Grand.Web.Common/TagHelpers/ScriptTagHelper.cs
@@ -66,9 +66,6 @@ namespace Grand.Web.Common.TagHelpers
case ScriptLocation.Footer:
_resourceManager.RegisterFootScript(builder, DisplayOrder);
break;
-
- default:
- break;
}
}
}