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.

Use preferred var style

supporte9b2f6516e5a
diff --git a/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateCategoryCommandHandler.cs b/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateCategoryCommandHandler.cs
index db6054d41..d5809e578 100644
--- a/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateCategoryCommandHandler.cs
+++ b/src/API/Grand.Api/Commands/Handlers/Catalog/UpdateCategoryCommandHandler.cs
@@ -48,7 +48,7 @@ namespace Grand.Api.Commands.Handlers.Catalog
public async Task<CategoryDto> Handle(UpdateCategoryCommand request, CancellationToken cancellationToken)
{
var category = await _categoryService.GetCategoryById(request.Model.Id);
- string prevPictureId = category.PictureId;
+ var prevPictureId = category.PictureId;
category = request.Model.ToEntity(category);
category.UpdatedOnUtc = DateTime.UtcNow;
request.Model.SeName = await category.ValidateSeName(request.Model.SeName, category.Name, true, _seoSettings, _slugService, _languageService);
diff --git a/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidMerchandiseReturnItem.cs b/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidMerchandiseReturnItem.cs
index 50430609d..5de09867f 100644
--- a/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidMerchandiseReturnItem.cs
+++ b/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidMerchandiseReturnItem.cs
@@ -24,7 +24,7 @@ namespace Grand.Business.Core.Utilities.Messages.DotLiquidDrops
public string ProductName {
get {
- string name = "";
+ var name = "";
if (_product != null)
name = WebUtility.HtmlEncode(_product.Name);
@@ -35,7 +35,7 @@ namespace Grand.Business.Core.Utilities.Messages.DotLiquidDrops
public string ProductSeName {
get {
- string name = "";
+ var name = "";
if (_product != null)
name = _product.SeName;
@@ -44,7 +44,7 @@ namespace Grand.Business.Core.Utilities.Messages.DotLiquidDrops
}
public string ProductShortDescription {
get {
- string desc = "";
+ var desc = "";
if (_product != null)
desc = WebUtility.HtmlEncode(_product.ShortDescription);
@@ -55,7 +55,7 @@ namespace Grand.Business.Core.Utilities.Messages.DotLiquidDrops
public string ProductFullDescription {
get {
- string desc = "";
+ var desc = "";
if (_product != null)
desc = WebUtility.HtmlDecode(_product.FullDescription);
diff --git a/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidNewsLetterSubscription.cs b/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidNewsLetterSubscription.cs
index b7caace68..9cdb69cfc 100644
--- a/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidNewsLetterSubscription.cs
+++ b/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidNewsLetterSubscription.cs
@@ -32,7 +32,7 @@ namespace Grand.Business.Core.Utilities.Messages.DotLiquidDrops
{
get
{
- string urlFormat = "{0}/newsletter/subscriptionactivation/{1}/{2}";
+ var urlFormat = "{0}/newsletter/subscriptionactivation/{1}/{2}";
var activationUrl = String.Format(urlFormat, url, _subscription.NewsLetterSubscriptionGuid, "true");
return activationUrl;
}
@@ -42,7 +42,7 @@ namespace Grand.Business.Core.Utilities.Messages.DotLiquidDrops
{
get
{
- string urlFormat = "{0}/newsletter/subscriptionactivation/{1}/{2}";
+ var urlFormat = "{0}/newsletter/subscriptionactivation/{1}/{2}";
var deActivationUrl = String.Format(urlFormat, url, _subscription.NewsLetterSubscriptionGuid, "false");
return deActivationUrl;
}
diff --git a/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidOrderItem.cs b/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidOrderItem.cs
index 1ee44bbac..38c07dde6 100644
--- a/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidOrderItem.cs
+++ b/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidOrderItem.cs
@@ -46,14 +46,14 @@ namespace Grand.Business.Core.Utilities.Messages.DotLiquidDrops
public string DownloadUrl {
get {
- string downloadUrl = string.Format("{0}/download/getdownload/{1}", url, _orderItem.OrderItemGuid);
+ var downloadUrl = string.Format("{0}/download/getdownload/{1}", url, _orderItem.OrderItemGuid);
return downloadUrl;
}
}
public string LicenseUrl {
get {
- string licenseUrl = string.Format("{0}/download/getlicense/{1}", url, _orderItem.OrderItemGuid);
+ var licenseUrl = string.Format("{0}/download/getlicense/{1}", url, _orderItem.OrderItemGuid);
return licenseUrl;
}
}
@@ -66,7 +66,7 @@ namespace Grand.Business.Core.Utilities.Messages.DotLiquidDrops
public string ProductName {
get {
- string name = "";
+ var name = "";
if (_product != null)
name = WebUtility.HtmlEncode(_product.GetTranslation(x => x.Name, _language.Id));
@@ -77,7 +77,7 @@ namespace Grand.Business.Core.Utilities.Messages.DotLiquidDrops
public string ProductSeName {
get {
- string name = "";
+ var name = "";
if (_product != null)
name = _product.GetTranslation(x => x.SeName, _language.Id);
@@ -86,7 +86,7 @@ namespace Grand.Business.Core.Utilities.Messages.DotLiquidDrops
}
public string ProductShortDescription {
get {
- string desc = "";
+ var desc = "";
if (_product != null)
desc = WebUtility.HtmlEncode(_product.GetTranslation(x => x.ShortDescription, _language.Id));
@@ -97,7 +97,7 @@ namespace Grand.Business.Core.Utilities.Messages.DotLiquidDrops
public string ProductFullDescription {
get {
- string desc = "";
+ var desc = "";
if (_product != null)
desc = WebUtility.HtmlDecode(_product.GetTranslation(x => x.FullDescription, _language.Id));
diff --git a/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidShipmentItem.cs b/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidShipmentItem.cs
index 68e86009e..47e1508c5 100644
--- a/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidShipmentItem.cs
+++ b/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidShipmentItem.cs
@@ -32,7 +32,7 @@ namespace Grand.Business.Core.Utilities.Messages.DotLiquidDrops
public string ProductName {
get {
- string name = "";
+ var name = "";
if (_product != null)
name = WebUtility.HtmlEncode(_product.Name);
@@ -48,7 +48,7 @@ namespace Grand.Business.Core.Utilities.Messages.DotLiquidDrops
public string AttributeDescription {
get {
- string attDesc = "";
+ var attDesc = "";
if (_orderItem != null)
attDesc = _orderItem.AttributeDescription;
diff --git a/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidShoppingCartItem.cs b/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidShoppingCartItem.cs
index 983628b0d..68c62a489 100644
--- a/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidShoppingCartItem.cs
+++ b/src/Business/Grand.Business.Core/Utilities/Messages/DotLiquidDrops/LiquidShoppingCartItem.cs
@@ -64,7 +64,7 @@ namespace Grand.Business.Core.Utilities.Messages.DotLiquidDrops
{
get
{
- string name = "";
+ var name = "";
if (_product != null)
name = WebUtility.HtmlEncode(_product.GetTranslation(x => x.Name, _language.Id));
@@ -77,7 +77,7 @@ namespace Grand.Business.Core.Utilities.Messages.DotLiquidDrops
{
get
{
- string name = "";
+ var name = "";
if (_product != null)
name = _product.GetTranslation(x => x.SeName, _language.Id);
@@ -88,7 +88,7 @@ namespace Grand.Business.Core.Utilities.Messages.DotLiquidDrops
{
get
{
- string desc = "";
+ var desc = "";
if (_product != null)
desc = WebUtility.HtmlEncode(_product.GetTranslation(x => x.ShortDescription, _language.Id));
@@ -101,7 +101,7 @@ namespace Grand.Business.Core.Utilities.Messages.DotLiquidDrops
{
get
{
- string desc = "";
+ var desc = "";
if (_product != null)
desc = WebUtility.HtmlDecode(_product.GetTranslation(x => x.FullDescription, _language.Id));
diff --git a/src/Core/Grand.Domain/Blogs/BlogExtensions.cs b/src/Core/Grand.Domain/Blogs/BlogExtensions.cs
index 3a1d662c1..c47f38161 100644
--- a/src/Core/Grand.Domain/Blogs/BlogExtensions.cs
+++ b/src/Core/Grand.Domain/Blogs/BlogExtensions.cs
@@ -10,8 +10,8 @@
var parsedTags = new List<string>();
if (!String.IsNullOrEmpty(blogPost.Tags))
{
- string[] tags2 = blogPost.Tags.Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries);
- foreach (string tag2 in tags2)
+ var tags2 = blogPost.Tags.Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries);
+ foreach (var tag2 in tags2)
{
var tmp = tag2.Trim();
if (!String.IsNullOrEmpty(tmp))
diff --git a/src/Core/Grand.Domain/Catalog/ProductExtensions.cs b/src/Core/Grand.Domain/Catalog/ProductExtensions.cs
index 44a17639f..5cfa4cc3e 100644
--- a/src/Core/Grand.Domain/Catalog/ProductExtensions.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductExtensions.cs
@@ -47,7 +47,7 @@ namespace Grand.Domain.Catalog
if (product == null)
throw new ArgumentNullException(nameof(product));
- bool result = product.ProductTags.FirstOrDefault(pt => pt == productTagName) != null;
+ var result = product.ProductTags.FirstOrDefault(pt => pt == productTagName) != null;
return result;
}
@@ -261,10 +261,10 @@ namespace Grand.Domain.Catalog
if (attributes1.Count != attributes2.Count)
return false;
- bool attributesEqual = true;
+ var attributesEqual = true;
foreach (var a1 in attributes1)
{
- bool hasAttribute = false;
+ var hasAttribute = false;
foreach (var a2 in attributes2)
{
if (a1.Id == a2.Id)
@@ -274,10 +274,10 @@ namespace Grand.Domain.Catalog
var values2Str = ParseValues(customAttributes2, a2.Id);
if (values1Str.Count == values2Str.Count)
{
- foreach (string str1 in values1Str)
+ foreach (var str1 in values1Str)
{
- bool hasValue = false;
- foreach (string str2 in values2Str)
+ var hasValue = false;
+ foreach (var str2 in values2Str)
{
//case insensitive?
if (str1.Trim() == str2.Trim())
@@ -347,7 +347,7 @@ namespace Grand.Domain.Catalog
var allFound = true;
foreach (var t1 in valuesThatShouldBeSelected)
{
- bool found = false;
+ var found = false;
foreach (var t2 in selectedValues)
if (t1 == t2)
found = true;
diff --git a/src/Core/Grand.Domain/Customers/CustomerExtensions.cs b/src/Core/Grand.Domain/Customers/CustomerExtensions.cs
index bae920fd0..d76654db5 100644
--- a/src/Core/Grand.Domain/Customers/CustomerExtensions.cs
+++ b/src/Core/Grand.Domain/Customers/CustomerExtensions.cs
@@ -70,7 +70,7 @@ namespace Grand.Domain.Customers
var firstName = customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.FirstName);
var lastName = customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.LastName);
- string fullName = "";
+ var fullName = "";
if (!String.IsNullOrWhiteSpace(firstName) && !String.IsNullOrWhiteSpace(lastName))
fullName = string.Format("{0} {1}", firstName, lastName);
else
@@ -98,7 +98,7 @@ namespace Grand.Domain.Customers
return "Customer.Guest";
}
- string result = string.Empty;
+ var result = string.Empty;
switch (customerNameFormat)
{
case CustomerNameFormat.Emails:
diff --git a/src/Core/Grand.Domain/Orders/GiftVoucherExtensions.cs b/src/Core/Grand.Domain/Orders/GiftVoucherExtensions.cs
index ac8a2b3ad..0899e04c6 100644
--- a/src/Core/Grand.Domain/Orders/GiftVoucherExtensions.cs
+++ b/src/Core/Grand.Domain/Orders/GiftVoucherExtensions.cs
@@ -64,7 +64,7 @@ namespace Grand.Domain.Orders
/// <returns>Gift voucher remaining amount</returns>
public static double GetGiftVoucherRemainingAmount(this GiftVoucher giftVoucher)
{
- double result = giftVoucher.Amount;
+ var result = giftVoucher.Amount;
foreach (var gcuh in giftVoucher.GiftVoucherUsageHistory)
result -= gcuh.UsedValue;
@@ -96,7 +96,7 @@ namespace Grand.Domain.Orders
if(!string.IsNullOrEmpty(giftVoucher.StoreId) && giftVoucher.StoreId!=store.Id)
return false;
- double remainingAmount = giftVoucher.GetGiftVoucherRemainingAmount();
+ var remainingAmount = giftVoucher.GetGiftVoucherRemainingAmount();
if (remainingAmount > 0)
return true;
diff --git a/src/Core/Grand.Domain/Orders/OrderExtensions.cs b/src/Core/Grand.Domain/Orders/OrderExtensions.cs
index 360bc53ec..f134f21ae 100644
--- a/src/Core/Grand.Domain/Orders/OrderExtensions.cs
+++ b/src/Core/Grand.Domain/Orders/OrderExtensions.cs
@@ -118,14 +118,14 @@ namespace Grand.Domain.Orders
/// Indicates whether a order's tag exists
/// </summary>
/// <param name="order">Order</param>
- /// <param name="orderTagId">Order tag identifier</param>
+ /// <param name="orderTag">Order tag identifier</param>
/// <returns>Result</returns>
public static bool OrderTagExists(this Order order, OrderTag orderTag)
{
if (order == null)
throw new ArgumentNullException(nameof(order));
- bool result = order.OrderTags.FirstOrDefault(t => t == orderTag.Id) != null;
+ var result = order.OrderTags.FirstOrDefault(t => t == orderTag.Id) != null;
return result;
}
}
diff --git a/src/Core/Grand.SharedKernel/Extensions/CommonHelper.cs b/src/Core/Grand.SharedKernel/Extensions/CommonHelper.cs
index a120d149e..c756cdba4 100644
--- a/src/Core/Grand.SharedKernel/Extensions/CommonHelper.cs
+++ b/src/Core/Grand.SharedKernel/Extensions/CommonHelper.cs
@@ -37,7 +37,7 @@ namespace Grand.SharedKernel.Extensions
/// <returns></returns>
public static string EnsureSubscriberEmailOrThrow(string email)
{
- string output = EnsureNotNull(email);
+ var output = EnsureNotNull(email);
output = output.Trim();
output = EnsureMaximumLength(output, 255);
@@ -153,7 +153,7 @@ namespace Grand.SharedKernel.Extensions
return false;
var comparer = EqualityComparer<T>.Default;
- for (int i = 0; i < a1.Length; i++)
+ for (var i = 0; i < a1.Length; i++)
{
if (!comparer.Equals(a1[i], a2[i])) return false;
}
@@ -246,7 +246,7 @@ namespace Grand.SharedKernel.Extensions
{
var str = value.ToString();
if (string.IsNullOrEmpty(str)) return string.Empty;
- string result = string.Empty;
+ var result = string.Empty;
foreach (var c in str)
if (c.ToString() != c.ToString().ToLower())
result += " " + c.ToString();
@@ -266,7 +266,7 @@ namespace Grand.SharedKernel.Extensions
{
//source: http://stackoverflow.com/questions/9/how-do-i-calculate-someones-age-in-c
//this assumes you are looking for the western idea of age and not using East Asian reckoning.
- int age = endDate.Year - startDate.Year;
+ var age = endDate.Year - startDate.Year;
if (startDate > endDate.AddYears(-age))
age--;
return age;
diff --git a/src/Tests/Grand.Business.Catalog.Tests/Services/Tax/TaxServiceTests.cs b/src/Tests/Grand.Business.Catalog.Tests/Services/Tax/TaxServiceTests.cs
index 3f5139613..6e99ccf4a 100644
--- a/src/Tests/Grand.Business.Catalog.Tests/Services/Tax/TaxServiceTests.cs
+++ b/src/Tests/Grand.Business.Catalog.Tests/Services/Tax/TaxServiceTests.cs
@@ -145,11 +145,11 @@ namespace Grand.Business.Catalog.Tests.Services.Tax
var customer = new Customer();
customer.IsTaxExempt = false;
- string taxCategoryId = ""; //as in code
- double scUnitPriceWithoutDiscount = 1000.00;
- double scUnitPrice = 1000.00;
- double scSubTotal = 5000.00;
- double discountAmount = 7000.00;
+ var taxCategoryId = ""; //as in code
+ var scUnitPriceWithoutDiscount = 1000.00;
+ var scUnitPrice = 1000.00;
+ var scSubTotal = 5000.00;
+ var discountAmount = 7000.00;
_groupServiceMock.Setup(c => c.GetAllByIds(It.IsAny<string[]>())).Returns(Task.FromResult<IList<CustomerGroup>>(new List<CustomerGroup>()));
//these 6 methods..
var scUnitPriceInclTax = (await _taxService.GetProductPrice(product, taxCategoryId, scUnitPrice, true, customer, true)).productprice;
@@ -178,12 +178,12 @@ namespace Grand.Business.Catalog.Tests.Services.Tax
product.IsTaxExempt = false;
var customer = new Customer();
customer.IsTaxExempt = false;
- string taxCategoryId = ""; //as in code
+ var taxCategoryId = ""; //as in code
_groupServiceMock.Setup(c => c.GetAllByIds(It.IsAny<string[]>())).Returns(Task.FromResult<IList<CustomerGroup>>(new List<CustomerGroup>()));
- double scUnitPriceWithoutDiscount = 1000.00;
- double scUnitPrice = 1000.00;
- double scSubTotal = 5000.00;
- double discountAmount = 7000.00;
+ var scUnitPriceWithoutDiscount = 1000.00;
+ var scUnitPrice = 1000.00;
+ var scSubTotal = 5000.00;
+ var discountAmount = 7000.00;
var scUnitPriceInclTax = (await _taxService.GetProductPrice(product, taxCategoryId, scUnitPrice, true, customer, false)).productprice;
var scUnitPriceExclTax = (await _taxService.GetProductPrice(product, taxCategoryId, scUnitPrice, false, customer, false)).productprice;
@@ -211,12 +211,12 @@ namespace Grand.Business.Catalog.Tests.Services.Tax
product.IsTaxExempt = true;
var customer = new Customer();
customer.IsTaxExempt = true;
- string taxCategoryId = "";
+ var taxCategoryId = "";
- double scUnitPriceWithoutDiscount = 1000.00;
- double scUnitPrice = 1000.00;
- double scSubTotal = 5000.00;
- double discountAmount = 7000.00;
+ var scUnitPriceWithoutDiscount = 1000.00;
+ var scUnitPrice = 1000.00;
+ var scSubTotal = 5000.00;
+ var discountAmount = 7000.00;
var scUnitPriceInclTax = (await _taxService.GetProductPrice(product, taxCategoryId, scUnitPrice, true, customer, true)).productprice;
var scUnitPriceExclTax = (await _taxService.GetProductPrice(product, taxCategoryId, scUnitPrice, false, customer, true)).productprice;
@@ -244,12 +244,12 @@ namespace Grand.Business.Catalog.Tests.Services.Tax
product.IsTaxExempt = true;
var customer = new Customer();
customer.IsTaxExempt = true;
- string taxCategoryId = "";
+ var taxCategoryId = "";
- double scUnitPriceWithoutDiscount = 1000.00;
- double scUnitPrice = 1000.00;
- double scSubTotal = 5000.00;
- double discountAmount = 7000.00;
+ var scUnitPriceWithoutDiscount = 1000.00;
+ var scUnitPrice = 1000.00;
+ var scSubTotal = 5000.00;
+ var discountAmount = 7000.00;
var scUnitPriceInclTax = (await _taxService.GetProductPrice(product, taxCategoryId, scUnitPrice, true, customer, false)).productprice;
var scUnitPriceExclTax = (await _taxService.GetProductPrice(product, taxCategoryId, scUnitPrice, false, customer, false)).productprice;
diff --git a/src/Tests/Grand.Business.Customers.Tests/Extensions/AffiliateExtensionsTests.cs b/src/Tests/Grand.Business.Customers.Tests/Extensions/AffiliateExtensionsTests.cs
index 49bd74f67..572f8792b 100644
--- a/src/Tests/Grand.Business.Customers.Tests/Extensions/AffiliateExtensionsTests.cs
+++ b/src/Tests/Grand.Business.Customers.Tests/Extensions/AffiliateExtensionsTests.cs
@@ -115,7 +115,7 @@ namespace Grand.Business.Customers.Tests.Extensions
[TestMethod()]
public async Task ValidateFriendlyUrlName_UrlNameExist_IncreaseUrl()
{
- int invokeNumber = 1;
+ var invokeNumber = 1;
_affiliateServiceMock.Setup(c => c.GetAffiliateByFriendlyUrlName(It.IsAny<string>()))
.Returns(() =>
{
diff --git a/src/Tests/Grand.Business.Marketing.Tests/Services/PushNotifications/PushNotificationsServiceTests.cs b/src/Tests/Grand.Business.Marketing.Tests/Services/PushNotifications/PushNotificationsServiceTests.cs
index 5b0975a5f..dfe6a5042 100644
--- a/src/Tests/Grand.Business.Marketing.Tests/Services/PushNotifications/PushNotificationsServiceTests.cs
+++ b/src/Tests/Grand.Business.Marketing.Tests/Services/PushNotifications/PushNotificationsServiceTests.cs
@@ -38,7 +38,7 @@ namespace Grand.Business.Marketing.Tests.Services.PushNotifications
var mockMessageHandler = new Mock<HttpMessageHandler>();
- string output = JsonConvert.SerializeObject(new JsonResponse() { success = 1, failure = 0, canonical_ids = 1 });
+ var output = JsonConvert.SerializeObject(new JsonResponse() { success = 1, failure = 0, canonical_ids = 1 });
mockMessageHandler.Protected()
.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
diff --git a/src/Tests/Grand.SharedKernel.Tests/Extensions/CommonHelperTests.cs b/src/Tests/Grand.SharedKernel.Tests/Extensions/CommonHelperTests.cs
index e4e61e9d7..f09ef3a0f 100644
--- a/src/Tests/Grand.SharedKernel.Tests/Extensions/CommonHelperTests.cs
+++ b/src/Tests/Grand.SharedKernel.Tests/Extensions/CommonHelperTests.cs
@@ -73,21 +73,21 @@ namespace Grand.SharedKernel.Tests.Extensions
[TestMethod()]
public void EnsureMaximumLengthTest_Value_3_True()
{
- string str = "value"; int max = 3; string post = null;
+ var str = "value"; var max = 3; string post = null;
Assert.IsTrue(CommonHelper.EnsureMaximumLength(str, max, post) == "val");
}
[TestMethod()]
public void EnsureMaximumLengthTest_Value_10_True()
{
- string str = "value"; int max = 10; string post = null;
+ var str = "value"; var max = 10; string post = null;
Assert.IsTrue(CommonHelper.EnsureMaximumLength(str, max, post) == "value");
}
[TestMethod()]
public void EnsureMaximumLengthTest_Value_2_Post_True()
{
- string str = "0123456789000"; int max = 10; string post = "...";
+ var str = "0123456789000"; var max = 10; var post = "...";
Assert.IsTrue(CommonHelper.EnsureMaximumLength(str, max, post) == "0123456...");
}
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Partials/OrderDetails.Products.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Partials/OrderDetails.Products.cshtml
index 4a9720600..8b712150f 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Partials/OrderDetails.Products.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Order/Partials/OrderDetails.Products.cshtml
@@ -91,7 +91,7 @@
</tr>
</thead>
<tbody>
- @for (int j = 0; j < Model.Items.Count; j++)
+ @for (var j = 0; j < Model.Items.Count; j++)
{
var item = Model.Items[j];
<input asp-for="@Model.Items[j].Id" type="hidden" />
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shipment/AddShipment.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shipment/AddShipment.cshtml
index f9b4347ff..d3aa54583 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shipment/AddShipment.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Shipment/AddShipment.cshtml
@@ -89,7 +89,7 @@
</tr>
</thead>
<tbody>
- @for (int j = 0; j < Model.Items.Count; j++)
+ @for (var j = 0; j < Model.Items.Count; j++)
{
var item = Model.Items[j];
<input asp-for="@Model.Items[j].OrderItemId" type="hidden"/>