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 parentheses

supporte8e6c0bee2ee
diff --git a/src/API/Grand.Api/Validators/Common/LoginValidator.cs b/src/API/Grand.Api/Validators/Common/LoginValidator.cs
index f64588ca6..715cf0083 100644
--- a/src/API/Grand.Api/Validators/Common/LoginValidator.cs
+++ b/src/API/Grand.Api/Validators/Common/LoginValidator.cs
@@ -34,7 +34,7 @@ namespace Grand.Api.Validators.Common
}
}
return false;
- }).WithMessage(("User not exists or password is wrong"));
+ }).WithMessage("User not exists or password is wrong");
RuleFor(x => x).MustAsync(async (x, _) =>
{
if (!string.IsNullOrEmpty(x.Email))
diff --git a/src/Business/Grand.Business.Catalog/Services/ExportImport/ProductImportDataObject.cs b/src/Business/Grand.Business.Catalog/Services/ExportImport/ProductImportDataObject.cs
index 2b8930e9e..01fdfab22 100644
--- a/src/Business/Grand.Business.Catalog/Services/ExportImport/ProductImportDataObject.cs
+++ b/src/Business/Grand.Business.Catalog/Services/ExportImport/ProductImportDataObject.cs
@@ -221,7 +221,7 @@ namespace Grand.Business.Catalog.Services.ExportImport
{
if (string.IsNullOrEmpty(picturePath))
continue;
- if (!picturePath.ToLower().StartsWith(("http".ToLower())))
+ if (!picturePath.ToLower().StartsWith("http".ToLower()))
{
var mimeType = MimeTypeExtensions.GetMimeTypeFromFilePath(picturePath);
var newPictureBinary = await File.ReadAllBytesAsync(picturePath);
diff --git a/src/Business/Grand.Business.Common/Services/ExportImport/ExcelExportProvider.cs b/src/Business/Grand.Business.Common/Services/ExportImport/ExcelExportProvider.cs
index 2c7db7a8c..da429d537 100644
--- a/src/Business/Grand.Business.Common/Services/ExportImport/ExcelExportProvider.cs
+++ b/src/Business/Grand.Business.Common/Services/ExportImport/ExcelExportProvider.cs
@@ -80,7 +80,7 @@ namespace Grand.Business.Common.Services.ExportImport
IRow row = sheet.CreateRow(idrow);
foreach (var prop in properties)
{
- var cellValue = (prop.GetProperty(items)?.ToString());
+ var cellValue = prop.GetProperty(items)?.ToString();
if (cellValue is { Length: >= 32767 }) // 32767 is the max char size of an excel cell
{
cellValue = cellValue[..32767]; //Truncate the content to max size.
diff --git a/src/Business/Grand.Business.System/Services/Reports/OrderReportService.cs b/src/Business/Grand.Business.System/Services/Reports/OrderReportService.cs
index 7aa797d9c..3dd27fdb8 100644
--- a/src/Business/Grand.Business.System/Services/Reports/OrderReportService.cs
+++ b/src/Business/Grand.Business.System/Services/Reports/OrderReportService.cs
@@ -498,7 +498,7 @@ namespace Grand.Business.System.Services.Reports
(string.IsNullOrEmpty(storeId) || order.StoreId == storeId) &&
createdFromUtc.Value <= order.CreatedOnUtc &&
createdToUtc.Value >= order.CreatedOnUtc &&
- (!order.Deleted)
+ !order.Deleted
from orderItem in order.OrderItems
select new { orderItem.ProductId }).ToList().Distinct().Select(x => x.ProductId);
@@ -506,7 +506,7 @@ namespace Grand.Business.System.Services.Reports
orderby p.Name
where !query.Contains(p.Id) &&
//include only simple products
- (p.ProductTypeId == ProductType.SimpleProduct) &&
+ p.ProductTypeId == ProductType.SimpleProduct &&
(vendorId == "" || p.VendorId == vendorId) &&
(string.IsNullOrEmpty(storeId) || p.Stores.Contains(storeId) || p.LimitedToStores == false) &&
(showHidden || p.Published)
diff --git a/src/Core/Grand.Domain/PagedList.cs b/src/Core/Grand.Domain/PagedList.cs
index e4e6768ea..bb67f68b4 100644
--- a/src/Core/Grand.Domain/PagedList.cs
+++ b/src/Core/Grand.Domain/PagedList.cs
@@ -80,10 +80,10 @@
public int TotalPages { get; protected set; }
public bool HasPreviousPage {
- get { return (PageIndex > 0); }
+ get { return PageIndex > 0; }
}
public bool HasNextPage {
- get { return (PageIndex + 1 < TotalPages); }
+ get { return PageIndex + 1 < TotalPages; }
}
}
}
diff --git a/src/Core/Grand.Infrastructure/Plugins/PluginManager.cs b/src/Core/Grand.Infrastructure/Plugins/PluginManager.cs
index 8a975cd0e..75aff50fe 100644
--- a/src/Core/Grand.Infrastructure/Plugins/PluginManager.cs
+++ b/src/Core/Grand.Infrastructure/Plugins/PluginManager.cs
@@ -150,7 +150,7 @@ namespace Grand.Infrastructure.Plugins
catch (ReflectionTypeLoadException ex)
{
var msg = $"Plugin '{plugin.FriendlyName}'. ";
- msg = ex.LoaderExceptions.Aggregate(msg, (current, e) => current + (e!.Message + Environment.NewLine));
+ msg = ex.LoaderExceptions.Aggregate(msg, (current, e) => current + e!.Message + Environment.NewLine);
var fail = new Exception(msg, ex);
throw fail;
diff --git a/src/Core/Grand.SharedKernel/Extensions/CommonHelper.cs b/src/Core/Grand.SharedKernel/Extensions/CommonHelper.cs
index b06ea3c18..a120d149e 100644
--- a/src/Core/Grand.SharedKernel/Extensions/CommonHelper.cs
+++ b/src/Core/Grand.SharedKernel/Extensions/CommonHelper.cs
@@ -112,7 +112,7 @@ namespace Grand.SharedKernel.Extensions
var result = str[..(maxLength - pLen)];
if(string.IsNullOrEmpty(result))
- return str[..(maxLength)];
+ return str[..maxLength];
if (!string.IsNullOrEmpty(postfix))
{
diff --git a/src/Tests/Grand.Business.Catalog.Tests/Services/Prices/PriceServiceTests.cs b/src/Tests/Grand.Business.Catalog.Tests/Services/Prices/PriceServiceTests.cs
index 068d4f86d..b6ffa6551 100644
--- a/src/Tests/Grand.Business.Catalog.Tests/Services/Prices/PriceServiceTests.cs
+++ b/src/Tests/Grand.Business.Catalog.Tests/Services/Prices/PriceServiceTests.cs
@@ -140,7 +140,7 @@ namespace Grand.Business.Catalog.Tests.Services.Prices
var currency = new Currency { Id = "1", CurrencyCode = "USD", Rate = 1, Published = true, MidpointRoundId = System.MidpointRounding.ToEven, RoundingTypeId = RoundingType.Rounding001 };
var customer = new Customer();
- var pr = (await _pricingService.GetFinalPrice(product, customer, currency, 0, false, 1));
+ var pr = await _pricingService.GetFinalPrice(product, customer, currency, 0, false, 1);
Assert.AreEqual(49.99, pr.finalPrice);
//returned price FOR ONE UNIT should be the same, even if quantity is different than 1
Assert.AreEqual(49.99, (await _pricingService.GetFinalPrice(product, customer, _currency, 0, false, 10)).finalPrice);
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 3bf941ce7..3f5139613 100644
--- a/src/Tests/Grand.Business.Catalog.Tests/Services/Tax/TaxServiceTests.cs
+++ b/src/Tests/Grand.Business.Catalog.Tests/Services/Tax/TaxServiceTests.cs
@@ -159,7 +159,7 @@ namespace Grand.Business.Catalog.Tests.Services.Tax
var discountAmountInclTax = (await _taxService.GetProductPrice(product, taxCategoryId, discountAmount, true, customer, true)).productprice;
var discountAmountExclTax = (await _taxService.GetProductPrice(product, taxCategoryId, discountAmount, false, customer, true)).productprice;
//..should return the same value as this one method's properties are having
- var result02 = (await _taxService.GetTaxProductPrice(product, customer, scUnitPrice, scUnitPriceWithoutDiscount, 1, scSubTotal, discountAmount, true));
+ var result02 = await _taxService.GetTaxProductPrice(product, customer, scUnitPrice, scUnitPriceWithoutDiscount, 1, scSubTotal, discountAmount, true);
Assert.AreEqual(scUnitPriceInclTax, result02.UnitPriceInclTax, "unit price including tax");
Assert.AreEqual(scUnitPriceExclTax, result02.UnitPriceExclTax, "unit price excluding tax");
@@ -192,7 +192,7 @@ namespace Grand.Business.Catalog.Tests.Services.Tax
var discountAmountInclTax = (await _taxService.GetProductPrice(product, taxCategoryId, discountAmount, true, customer, false)).productprice;
var discountAmountExclTax = (await _taxService.GetProductPrice(product, taxCategoryId, discountAmount, false, customer, false)).productprice;
- var result02 = (await _taxService.GetTaxProductPrice(product, customer, scUnitPrice, scUnitPriceWithoutDiscount, 1, scSubTotal, discountAmount, false));
+ var result02 = await _taxService.GetTaxProductPrice(product, customer, scUnitPrice, scUnitPriceWithoutDiscount, 1, scSubTotal, discountAmount, false);
Assert.AreEqual(scUnitPriceInclTax, result02.UnitPriceInclTax, "unit price including tax");
Assert.AreEqual(scUnitPriceExclTax, result02.UnitPriceExclTax, "unit price excluding tax");
@@ -225,7 +225,7 @@ namespace Grand.Business.Catalog.Tests.Services.Tax
var discountAmountInclTax = (await _taxService.GetProductPrice(product, taxCategoryId, discountAmount, true, customer, true)).productprice;
var discountAmountExclTax = (await _taxService.GetProductPrice(product, taxCategoryId, discountAmount, false, customer, true)).productprice;
- var result02 = (await _taxService.GetTaxProductPrice(product, customer, scUnitPrice, scUnitPriceWithoutDiscount, 1, scSubTotal, discountAmount, true));
+ var result02 = await _taxService.GetTaxProductPrice(product, customer, scUnitPrice, scUnitPriceWithoutDiscount, 1, scSubTotal, discountAmount, true);
Assert.AreEqual(scUnitPriceInclTax, result02.UnitPriceInclTax, "unit price including tax");
Assert.AreEqual(scUnitPriceExclTax, result02.UnitPriceExclTax, "unit price excluding tax");
@@ -258,7 +258,7 @@ namespace Grand.Business.Catalog.Tests.Services.Tax
var discountAmountInclTax = (await _taxService.GetProductPrice(product, taxCategoryId, discountAmount, true, customer, false)).productprice;
var discountAmountExclTax = (await _taxService.GetProductPrice(product, taxCategoryId, discountAmount, false, customer, false)).productprice;
- var result02 = await (_taxService.GetTaxProductPrice(product, customer, scUnitPrice, scUnitPriceWithoutDiscount, 1, scSubTotal, discountAmount, false));
+ var result02 = await _taxService.GetTaxProductPrice(product, customer, scUnitPrice, scUnitPriceWithoutDiscount, 1, scSubTotal, discountAmount, false);
Assert.AreEqual(scUnitPriceInclTax, result02.UnitPriceInclTax, "unit price including tax");
Assert.AreEqual(scUnitPriceExclTax, result02.UnitPriceExclTax, "unit price excluding tax");
diff --git a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerValidator.cs b/src/Web/Grand.Web.Admin/Validators/Customers/CustomerValidator.cs
index 2deddf3f0..c155ba6ca 100644
--- a/src/Web/Grand.Web.Admin/Validators/Customers/CustomerValidator.cs
+++ b/src/Web/Grand.Web.Admin/Validators/Customers/CustomerValidator.cs
@@ -154,7 +154,7 @@ namespace Grand.Web.Admin.Validators.Customers
}
void CustomerCreateValidator()
{
- When(x => (currentAction == "Create" && currentController == "Customer"), () =>
+ When(x => currentAction == "Create" && currentController == "Customer", () =>
{
RuleFor(x => x).CustomAsync(async (x, context, y) =>
{
@@ -194,7 +194,7 @@ namespace Grand.Web.Admin.Validators.Customers
void CustomerEditValidator()
{
- When(x => (currentAction == "Edit" && currentController == "Customer"), () =>
+ When(x => currentAction == "Edit" && currentController == "Customer", () =>
{
RuleFor(x => x).CustomAsync(async (x, context, y) =>
{
diff --git a/src/Web/Grand.Web.Common/Page/Paging/BasePageableModel.cs b/src/Web/Grand.Web.Common/Page/Paging/BasePageableModel.cs
index d0d884fd3..8bcacc954 100644
--- a/src/Web/Grand.Web.Common/Page/Paging/BasePageableModel.cs
+++ b/src/Web/Grand.Web.Common/Page/Paging/BasePageableModel.cs
@@ -13,7 +13,7 @@ namespace Grand.Web.Common.Page.Paging
FirstItem = pagedList.PageIndex * pagedList.PageSize + 1;
HasNextPage = pagedList.HasNextPage;
HasPreviousPage = pagedList.HasPreviousPage;
- LastItem = Math.Min(pagedList.TotalCount, (pagedList.PageIndex * pagedList.PageSize) + pagedList.PageSize);
+ LastItem = Math.Min(pagedList.TotalCount, pagedList.PageIndex * pagedList.PageSize + pagedList.PageSize);
PageNumber = pagedList.PageIndex + 1;
PageSize = pagedList.PageSize;
TotalItems = pagedList.TotalCount;
diff --git a/src/Web/Grand.Web.Common/TagHelpers/Admin/Extend/DefaultDisplayTemplates.cs b/src/Web/Grand.Web.Common/TagHelpers/Admin/Extend/DefaultDisplayTemplates.cs
index 074e434b5..4ec06fe5e 100644
--- a/src/Web/Grand.Web.Common/TagHelpers/Admin/Extend/DefaultDisplayTemplates.cs
+++ b/src/Web/Grand.Web.Common/TagHelpers/Admin/Extend/DefaultDisplayTemplates.cs
@@ -65,8 +65,8 @@ namespace Grand.Web.Common.TagHelpers.Admin.Extend
return new List<SelectListItem>
{
new SelectListItem("Not Set", string.Empty, !value.HasValue),
- new SelectListItem("True", "true", (value == true)),
- new SelectListItem("False", "false", (value == false)),
+ new SelectListItem("True", "true", value == true),
+ new SelectListItem("False", "false", value == false),
};
}
@@ -157,10 +157,10 @@ namespace Grand.Web.Common.TagHelpers.Admin.Extend
public static async Task<IHtmlContent> EmailAddressTemplate(IHtmlHelper htmlHelper)
{
- var uriString = "mailto:" + ((htmlHelper.ViewData.Model == null) ?
+ var uriString = "mailto:" + (htmlHelper.ViewData.Model == null ?
string.Empty :
htmlHelper.ViewData.Model.ToString());
- var linkedText = (htmlHelper.ViewData.TemplateInfo.FormattedModelValue == null) ?
+ var linkedText = htmlHelper.ViewData.TemplateInfo.FormattedModelValue == null ?
string.Empty :
htmlHelper.ViewData.TemplateInfo.FormattedModelValue.ToString();
@@ -273,8 +273,8 @@ namespace Grand.Web.Common.TagHelpers.Admin.Extend
public static async Task<IHtmlContent> UrlTemplate(IHtmlHelper htmlHelper)
{
- var uriString = (htmlHelper.ViewData.Model == null) ? string.Empty : htmlHelper.ViewData.Model.ToString();
- var linkedText = (htmlHelper.ViewData.TemplateInfo.FormattedModelValue == null) ?
+ var uriString = htmlHelper.ViewData.Model == null ? string.Empty : htmlHelper.ViewData.Model.ToString();
+ var linkedText = htmlHelper.ViewData.TemplateInfo.FormattedModelValue == null ?
string.Empty :
htmlHelper.ViewData.TemplateInfo.FormattedModelValue.ToString();
diff --git a/src/Web/Grand.Web.Common/TagHelpers/Admin/Extend/DefaultHtmlGenerator.cs b/src/Web/Grand.Web.Common/TagHelpers/Admin/Extend/DefaultHtmlGenerator.cs
index ce65e1354..e1b972fed 100644
--- a/src/Web/Grand.Web.Common/TagHelpers/Admin/Extend/DefaultHtmlGenerator.cs
+++ b/src/Web/Grand.Web.Common/TagHelpers/Admin/Extend/DefaultHtmlGenerator.cs
@@ -125,7 +125,7 @@ namespace Grand.Web.Common.TagHelpers.Admin.Extend
/// <inheritdoc />
public string Encode(object value)
{
- return (value != null) ? _htmlEncoder.Encode(value.ToString()) : string.Empty;
+ return value != null ? _htmlEncoder.Encode(value.ToString()) : string.Empty;
}
/// <inheritdoc />
@@ -254,7 +254,7 @@ namespace Grand.Web.Common.TagHelpers.Admin.Extend
modelExplorer,
expression,
value: "true",
- useViewData: (modelExplorer == null && !isChecked.HasValue),
+ useViewData: modelExplorer == null && !isChecked.HasValue,
isChecked: isChecked ?? false,
setId: true,
isExplicitValue: false,
@@ -765,7 +765,7 @@ namespace Grand.Web.Common.TagHelpers.Admin.Extend
modelExplorer,
expression,
value,
- useViewData: (modelExplorer == null && value == null),
+ useViewData: modelExplorer == null && value == null,
isChecked: false,
setId: true,
isExplicitValue: true,
@@ -826,7 +826,7 @@ namespace Grand.Web.Common.TagHelpers.Admin.Extend
// Only the style of the span is changed according to the errors if message is null or empty.
// Otherwise the content and style is handled by the client-side validation.
- var className = (modelError != null) ?
+ var className = modelError != null ?
HtmlHelper.ValidationMessageCssClassName :
HtmlHelper.ValidationMessageValidCssClassName;
tagBuilder.AddCssClass(className);
@@ -1040,7 +1040,7 @@ namespace Grand.Web.Common.TagHelpers.Admin.Extend
foreach (var value in rawValues)
{
// Add original or converted string.
- var stringValue = (value as string) ?? Convert.ToString(value, CultureInfo.CurrentCulture);
+ var stringValue = value as string ?? Convert.ToString(value, CultureInfo.CurrentCulture);
// Do not add simple names of enum properties here because whitespace isn't relevant for their binding.
// Will add matching names just below.
diff --git a/src/Web/Grand.Web.Common/TagHelpers/Admin/Extend/ViewBufferTextWriter.cs b/src/Web/Grand.Web.Common/TagHelpers/Admin/Extend/ViewBufferTextWriter.cs
index efcc02efe..78f2fa844 100644
--- a/src/Web/Grand.Web.Common/TagHelpers/Admin/Extend/ViewBufferTextWriter.cs
+++ b/src/Web/Grand.Web.Common/TagHelpers/Admin/Extend/ViewBufferTextWriter.cs
@@ -106,7 +106,7 @@ namespace Grand.Web.Common.TagHelpers.Admin.Extend
throw new ArgumentOutOfRangeException(nameof(index));
}
- if (count < 0 || (buffer.Length - index < count))
+ if (count < 0 || buffer.Length - index < count)
{
throw new ArgumentOutOfRangeException(nameof(count));
}
@@ -252,7 +252,7 @@ namespace Grand.Web.Common.TagHelpers.Admin.Extend
{
throw new ArgumentOutOfRangeException(nameof(index));
}
- if (count < 0 || (buffer.Length - index < count))
+ if (count < 0 || buffer.Length - index < count)
{
throw new ArgumentOutOfRangeException(nameof(count));
}
diff --git a/src/Web/Grand.Web.Common/TagHelpers/DatePickerDropDownsTagHelper.cs b/src/Web/Grand.Web.Common/TagHelpers/DatePickerDropDownsTagHelper.cs
index c6647ffce..4a05c6b27 100644
--- a/src/Web/Grand.Web.Common/TagHelpers/DatePickerDropDownsTagHelper.cs
+++ b/src/Web/Grand.Web.Common/TagHelpers/DatePickerDropDownsTagHelper.cs
@@ -76,13 +76,13 @@ namespace Grand.Web.Common.TagHelpers
model.SelectListDay.Add(new SelectListItem() { Value = "0", Text = _translationService.GetResource("Common.Day") });
for (var i = 1; i <= 31; i++)
{
- model.SelectListDay.Add(new SelectListItem() { Value = i.ToString(), Text = i.ToString(), Selected = (SelectedDay == i) });
+ model.SelectListDay.Add(new SelectListItem() { Value = i.ToString(), Text = i.ToString(), Selected = SelectedDay == i });
}
model.SelectListMonth.Add(new SelectListItem() { Value = "0", Text = _translationService.GetResource("Common.Month") });
for (var i = 1; i <= 12; i++)
{
- model.SelectListMonth.Add(new SelectListItem() { Value = i.ToString(), Text = CultureInfo.CurrentUICulture.DateTimeFormat.GetMonthName(i), Selected = (SelectedMonth == i) });
+ model.SelectListMonth.Add(new SelectListItem() { Value = i.ToString(), Text = CultureInfo.CurrentUICulture.DateTimeFormat.GetMonthName(i), Selected = SelectedMonth == i });
}
model.SelectListYear.Add(new SelectListItem() { Value = "0", Text = _translationService.GetResource("Common.Year") });
@@ -95,12 +95,12 @@ namespace Grand.Web.Common.TagHelpers
if (End_Year > Begin_Year)
{
for (var i = Begin_Year; i <= End_Year; i++)
- model.SelectListYear.Add(new SelectListItem() { Value = i.ToString(), Text = i.ToString(), Selected = (SelectedYear == i) });
+ model.SelectListYear.Add(new SelectListItem() { Value = i.ToString(), Text = i.ToString(), Selected = SelectedYear == i });
}
else
{
for (var i = Begin_Year; i >= End_Year; i--)
- model.SelectListYear.Add(new SelectListItem() { Value = i.ToString(), Text = i.ToString(), Selected = (SelectedYear == i) });
+ model.SelectListYear.Add(new SelectListItem() { Value = i.ToString(), Text = i.ToString(), Selected = SelectedYear == i });
}
output.Content.SetHtmlContent((await _htmlHelper.PartialAsync(PartialViewName, model)).ToHtmlString());
diff --git a/src/Web/Grand.Web.Common/TagHelpers/PageNavigationTagHelper.cs b/src/Web/Grand.Web.Common/TagHelpers/PageNavigationTagHelper.cs
index af69924ba..7e94a8387 100644
--- a/src/Web/Grand.Web.Common/TagHelpers/PageNavigationTagHelper.cs
+++ b/src/Web/Grand.Web.Common/TagHelpers/PageNavigationTagHelper.cs
@@ -121,7 +121,7 @@ namespace Grand.Web.Common.TagHelpers
return null;
var links = new StringBuilder();
- if (ShowTotalSummary && (Pagination.TotalPages > 0))
+ if (ShowTotalSummary && Pagination.TotalPages > 0)
{
links.Append("<li class=\"total-summary\">");
links.Append(string.Format(_translationService.GetResource("Pager.CurrentPage"),
@@ -129,12 +129,12 @@ namespace Grand.Web.Common.TagHelpers
links.Append("</li>");
}
- if (ShowPagerItems && (Pagination.TotalPages > 1))
+ if (ShowPagerItems && Pagination.TotalPages > 1)
{
if (ShowFirst)
{
//first page
- if ((Pagination.PageIndex >= 3) && (Pagination.TotalPages > IndividualPagesDisplayedCount))
+ if (Pagination.PageIndex >= 3 && Pagination.TotalPages > IndividualPagesDisplayedCount)
{
links.Append(CreatePageLink(1, _translationService.GetResource("Pager.First"),
"first-page page-item"));
@@ -161,7 +161,7 @@ namespace Grand.Web.Common.TagHelpers
if (Pagination.PageIndex == i)
{
links.Append(
- $"<li class=\"current-page page-item\"><a class=\"page-link\">{(i + 1)}</a></li>");
+ $"<li class=\"current-page page-item\"><a class=\"page-link\">{i + 1}</a></li>");
}
else
{
@@ -184,7 +184,7 @@ namespace Grand.Web.Common.TagHelpers
{
//last page
if (Pagination.PageIndex + 3 < Pagination.TotalPages &&
- (Pagination.TotalPages > IndividualPagesDisplayedCount))
+ Pagination.TotalPages > IndividualPagesDisplayedCount)
{
links.Append(CreatePageLink(Pagination.TotalPages,
_translationService.GetResource("Pager.Last"), "last-page page-item"));
@@ -269,17 +269,17 @@ namespace Grand.Web.Common.TagHelpers
protected virtual int GetFirstIndividualPageIndex()
{
if (Pagination.TotalPages < IndividualPagesDisplayedCount ||
- ((Pagination.PageIndex - IndividualPagesDisplayedCount / 2) < 0))
+ Pagination.PageIndex - IndividualPagesDisplayedCount / 2 < 0)
{
return 0;
}
- if ((Pagination.PageIndex + IndividualPagesDisplayedCount / 2) >= Pagination.TotalPages)
+ if (Pagination.PageIndex + IndividualPagesDisplayedCount / 2 >= Pagination.TotalPages)
{
- return (Pagination.TotalPages - IndividualPagesDisplayedCount);
+ return Pagination.TotalPages - IndividualPagesDisplayedCount;
}
- return (Pagination.PageIndex - IndividualPagesDisplayedCount / 2);
+ return Pagination.PageIndex - IndividualPagesDisplayedCount / 2;
}
protected virtual int GetLastIndividualPageIndex()
@@ -293,15 +293,15 @@ namespace Grand.Web.Common.TagHelpers
if (Pagination.TotalPages < IndividualPagesDisplayedCount ||
Pagination.PageIndex + num >= Pagination.TotalPages)
{
- return (Pagination.TotalPages - 1);
+ return Pagination.TotalPages - 1;
}
- if ((Pagination.PageIndex - (IndividualPagesDisplayedCount / 2)) < 0)
+ if (Pagination.PageIndex - IndividualPagesDisplayedCount / 2 < 0)
{
- return (IndividualPagesDisplayedCount - 1);
+ return IndividualPagesDisplayedCount - 1;
}
- return (Pagination.PageIndex + num);
+ return Pagination.PageIndex + num;
}
}
}
\ No newline at end of file