Skip to content

Commit

Permalink
nopSolutions#196 Update NuGet packages for .NET 7.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyKulagin committed Mar 10, 2023
1 parent 67a1636 commit 4929895
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 93 deletions.
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.101",
"version": "7.0.201",
"rollForward": "latestFeature",
"allowPrerelease": false
}
Expand Down
14 changes: 7 additions & 7 deletions src/Libraries/Nop.Core/Nop.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
<ItemGroup>
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
<PackageReference Include="Azure.Extensions.AspNetCore.DataProtection.Blobs" Version="1.2.3" />
<PackageReference Include="Azure.Extensions.AspNetCore.DataProtection.Keys" Version="1.1.0" />
<PackageReference Include="Azure.Identity" Version="1.8.0" />
<PackageReference Include="Azure.Extensions.AspNetCore.DataProtection.Blobs" Version="1.3.1" />
<PackageReference Include="Azure.Extensions.AspNetCore.DataProtection.Keys" Version="1.2.1" />
<PackageReference Include="Azure.Identity" Version="1.8.2" />
<PackageReference Include="Humanizer" Version="2.14.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.3" />
<PackageReference Include="Microsoft.Azure.Services.AppAuthentication" Version="1.6.2" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="7.0.3" />
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="7.0.3" />
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.2.22" />
<PackageReference Include="Nito.AsyncEx.Coordination" Version="5.1.2" />
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
Expand Down
6 changes: 3 additions & 3 deletions src/Libraries/Nop.Data/Nop.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<PackageReference Include="FluentMigrator" Version="3.3.2" />
<PackageReference Include="FluentMigrator.Runner" Version="3.3.2" />
<PackageReference Include="linq2db" Version="4.3.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.0.1" />
<PackageReference Include="MySqlConnector" Version="2.2.2" />
<PackageReference Include="Npgsql" Version="7.0.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.0" />
<PackageReference Include="MySqlConnector" Version="2.2.5" />
<PackageReference Include="Npgsql" Version="7.0.2" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
</ItemGroup>
Expand Down
54 changes: 8 additions & 46 deletions src/Libraries/Nop.Services/ExportImport/Help/PropertyManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public virtual async Task WriteDefaultToXlsxAsync(IXLWorksheet worksheet, int ro
{
var fCell = fWorksheet.Row(fRow++).Cell(prop.PropertyOrderPosition);

if (fCell.Value != null && fCell.Value.ToString() == dropDownElement)
if (!fCell.IsEmpty() && fCell.Value.ToString() == dropDownElement)
break;

fCell.Value = dropDownElement;
Expand All @@ -223,26 +223,7 @@ public virtual async Task WriteDefaultToXlsxAsync(IXLWorksheet worksheet, int ro
else
{
var value = await prop.GetProperty(CurrentObject, CurrentLanguage);
if (value is string stringValue)
{
cell.SetValue(stringValue);
}
else if (value is char charValue)
{
cell.SetValue(charValue);
}
else if (value is Guid guidValue)
{
cell.SetValue(guidValue);
}
else if (value is Enum enumValue)
{
cell.SetValue(enumValue);
}
else
{
cell.Value = value;
}
cell.SetValue((XLCellValue)value?.ToString());
}
cell.Style.Alignment.WrapText = false;
}
Expand Down Expand Up @@ -293,7 +274,7 @@ public virtual async Task WriteLocalizedToXlsxAsync(IXLWorksheet worksheet, int
{
var fCell = fWorksheet.Row(fRow++).Cell(prop.PropertyOrderPosition);

if (fCell.Value != null && fCell.Value.ToString() == dropDownElement)
if (!fCell.IsEmpty() && fCell.Value.ToString() == dropDownElement)
break;

fCell.Value = dropDownElement;
Expand All @@ -304,26 +285,7 @@ public virtual async Task WriteLocalizedToXlsxAsync(IXLWorksheet worksheet, int
else
{
var value = await prop.GetProperty(CurrentObject, CurrentLanguage);
if (value is string stringValue)
{
cell.SetValue(stringValue);
}
else if (value is char charValue)
{
cell.SetValue(charValue);
}
else if (value is Guid guidValue)
{
cell.SetValue(guidValue);
}
else if (value is Enum enumValue)
{
cell.SetValue(enumValue);
}
else
{
cell.Value = value;
}
cell.SetValue((XLCellValue)value?.ToString());
}
cell.Style.Alignment.WrapText = false;
}
Expand Down Expand Up @@ -374,7 +336,7 @@ public virtual void WriteDefaultCaption(IXLWorksheet worksheet, int row = 1, int
foreach (var caption in _defaultProperties.Values)
{
var cell = worksheet.Row(row).Cell(caption.PropertyOrderPosition + cellOffset);
cell.Value = caption;
cell.Value = caption.ToString();

SetCaptionStyle(cell);
}
Expand All @@ -391,7 +353,7 @@ public virtual void WriteLocalizedCaption(IXLWorksheet worksheet, int row = 1, i
foreach (var caption in _localizedProperties.Values)
{
var cell = worksheet.Row(row).Cell(caption.PropertyOrderPosition + cellOffset);
cell.Value = caption;
cell.Value = caption.ToString();

SetCaptionStyle(cell);
}
Expand Down Expand Up @@ -420,7 +382,7 @@ public void SetCaptionStyle(IXLCell cell)
/// <returns></returns>
public PropertyByName<T, L> GetDefaultProperty(string propertyName)
{
return _defaultProperties.ContainsKey(propertyName) ? _defaultProperties[propertyName] : null;
return _defaultProperties.TryGetValue(propertyName, out var value) ? value : null;
}

/// <summary>
Expand All @@ -430,7 +392,7 @@ public PropertyByName<T, L> GetDefaultProperty(string propertyName)
/// <returns></returns>
public PropertyByName<T, L> GetLocalizedProperty(string propertyName)
{
return _localizedProperties.ContainsKey(propertyName) ? _localizedProperties[propertyName] : null;
return _localizedProperties.TryGetValue(propertyName, out var value) ? value : null;
}

/// <summary>
Expand Down
42 changes: 20 additions & 22 deletions src/Libraries/Nop.Services/ExportImport/ImportManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,7 @@ await _pictureService.ValidatePictureAsync(newPictureBinary, mimeType, seoFileNa
ExportImportDefaults.ImageHashAlgorithm,
trimByteCount);

var imagesIds = productsImagesIds.ContainsKey(product.ProductItem.Id)
? productsImagesIds[product.ProductItem.Id]
: Array.Empty<int>();
var imagesIds = productsImagesIds.TryGetValue(product.ProductItem.Id, out var value) ? value : Array.Empty<int>();

pictureAlreadyExists = allPicturesHashes.Where(p => imagesIds.Contains(p.Key))
.Select(p => p.Value)
Expand Down Expand Up @@ -510,9 +508,9 @@ await _productService.InsertProductPictureAsync(new ProductPicture
var categoryName = manager.GetDefaultProperty("ParentCategoryName").StringValue;
if (!string.IsNullOrEmpty(categoryName))
{
var parentCategory = allCategories.ContainsKey(categoryName)
var parentCategory = allCategories.TryGetValue(categoryName, out var value)
//try find category by full name with all parent category names
? await allCategories[categoryName]
? await value
//try find category by name
: await await allCategories.Values.FirstOrDefaultAwaitAsync(async c => (await c).Name.Equals(categoryName, StringComparison.InvariantCulture));

Expand Down Expand Up @@ -590,9 +588,9 @@ await _productService.InsertProductPictureAsync(new ProductPicture
var categoryName = manager.GetDefaultProperty("Name").StringValue;
if (!string.IsNullOrEmpty(categoryName))
{
category = allCategories.ContainsKey(categoryName)
category = allCategories.TryGetValue(categoryName, out var value)
//try find category by full name with all parent category names
? await allCategories[categoryName]
? await value
//try find category by name
: await await allCategories.Values.FirstOrDefaultAwaitAsync(async c => (await c).Name.Equals(categoryName, StringComparison.InvariantCulture));
}
Expand Down Expand Up @@ -1181,13 +1179,13 @@ private async Task<ImportProductMetadata> PrepareImportProductDataAsync(IXLWorkb
{
var allColumnsAreEmpty = manager.GetDefaultProperties
.Select(property => defaultWorksheet.Row(endRow).Cell(property.PropertyOrderPosition))
.All(cell => string.IsNullOrEmpty(cell?.Value?.ToString()));
.All(cell => string.IsNullOrEmpty(cell?.Value.ToString()));

if (allColumnsAreEmpty)
break;

if (new[] { 1, 2 }.Select(cellNum => defaultWorksheet.Row(endRow).Cell(cellNum))
.All(cell => string.IsNullOrEmpty(cell?.Value?.ToString())) &&
.All(cell => string.IsNullOrEmpty(cell?.Value.ToString())) &&
defaultWorksheet.Row(endRow).OutlineLevel == 0)
{
var cellValue = defaultWorksheet.Row(endRow).Cell(attributeIdCellNum).Value;
Expand All @@ -1212,7 +1210,7 @@ private async Task<ImportProductMetadata> PrepareImportProductDataAsync(IXLWorkb
case ExportedAttributeType.ProductAttribute:
productAttributeManager.ReadDefaultFromXlsx(defaultWorksheet, endRow,
ExportProductAttribute.ProductAttributeCellOffset);
if (int.TryParse((defaultWorksheet.Row(endRow).Cell(attributeIdCellNum).Value ?? string.Empty).ToString(), out var aid))
if (int.TryParse(defaultWorksheet.Row(endRow).Cell(attributeIdCellNum).Value.ToString(), out var aid))
{
allAttributeIds.Add(aid);
}
Expand All @@ -1221,7 +1219,7 @@ private async Task<ImportProductMetadata> PrepareImportProductDataAsync(IXLWorkb
case ExportedAttributeType.SpecificationAttribute:
specificationAttributeManager.ReadDefaultFromXlsx(defaultWorksheet, endRow, ExportProductAttribute.ProductAttributeCellOffset);

if (int.TryParse((defaultWorksheet.Row(endRow).Cell(specificationAttributeOptionIdCellNum).Value ?? string.Empty).ToString(), out var saoid))
if (int.TryParse(defaultWorksheet.Row(endRow).Cell(specificationAttributeOptionIdCellNum).Value.ToString(), out var saoid))
{
allSpecificationAttributeOptionIds.Add(saoid);
}
Expand All @@ -1235,7 +1233,7 @@ private async Task<ImportProductMetadata> PrepareImportProductDataAsync(IXLWorkb

if (categoryCellNum > 0)
{
var categoryIds = defaultWorksheet.Row(endRow).Cell(categoryCellNum).Value?.ToString() ?? string.Empty;
var categoryIds = defaultWorksheet.Row(endRow).Cell(categoryCellNum).Value.ToString() ?? string.Empty;

if (!string.IsNullOrEmpty(categoryIds))
allCategories.AddRange(categoryIds
Expand All @@ -1245,15 +1243,15 @@ private async Task<ImportProductMetadata> PrepareImportProductDataAsync(IXLWorkb

if (skuCellNum > 0)
{
var sku = defaultWorksheet.Row(endRow).Cell(skuCellNum).Value?.ToString() ?? string.Empty;
var sku = defaultWorksheet.Row(endRow).Cell(skuCellNum).Value.ToString() ?? string.Empty;

if (!string.IsNullOrEmpty(sku))
allSku.Add(sku);
}

if (manufacturerCellNum > 0)
{
var manufacturerIds = defaultWorksheet.Row(endRow).Cell(manufacturerCellNum).Value?.ToString() ??
var manufacturerIds = defaultWorksheet.Row(endRow).Cell(manufacturerCellNum).Value.ToString() ??
string.Empty;
if (!string.IsNullOrEmpty(manufacturerIds))
allManufacturers.AddRange(manufacturerIds
Expand All @@ -1262,7 +1260,7 @@ private async Task<ImportProductMetadata> PrepareImportProductDataAsync(IXLWorkb

if (limitedToStoresCellNum > 0)
{
var storeIds = defaultWorksheet.Row(endRow).Cell(limitedToStoresCellNum).Value?.ToString() ??
var storeIds = defaultWorksheet.Row(endRow).Cell(limitedToStoresCellNum).Value.ToString() ??
string.Empty;
if (!string.IsNullOrEmpty(storeIds))
allStores.AddRange(storeIds
Expand Down Expand Up @@ -1432,7 +1430,7 @@ private IList<string> SplitProductFile(IXLWorksheet worksheet, ImportProductMeta
{
var allColumnsAreEmpty = manager.GetDefaultProperties
.Select(property => worksheet.Row(endRow).Cell(property.PropertyOrderPosition))
.All(cell => string.IsNullOrEmpty(cell?.Value?.ToString()));
.All(cell => string.IsNullOrEmpty(cell?.Value.ToString()));

if (allColumnsAreEmpty)
break;
Expand All @@ -1453,14 +1451,14 @@ private IList<string> SplitProductFile(IXLWorksheet worksheet, ImportProductMeta

if (orderGuidCellNum > 0)
{
var orderGuidString = worksheet.Row(endRow).Cell(orderGuidCellNum).Value?.ToString() ?? string.Empty;
var orderGuidString = worksheet.Row(endRow).Cell(orderGuidCellNum).Value.ToString() ?? string.Empty;
if (!string.IsNullOrEmpty(orderGuidString) && Guid.TryParse(orderGuidString, out var orderGuid))
allOrderGuids.Add(orderGuid);
}

if (customerGuidCellNum > 0)
{
var customerGuidString = worksheet.Row(endRow).Cell(customerGuidCellNum).Value?.ToString() ?? string.Empty;
var customerGuidString = worksheet.Row(endRow).Cell(customerGuidCellNum).Value.ToString() ?? string.Empty;
if (!string.IsNullOrEmpty(customerGuidString) && Guid.TryParse(customerGuidString, out var customerGuid))
allCustomerGuids.Add(customerGuid);
}
Expand Down Expand Up @@ -1630,7 +1628,7 @@ public static WorkbookMetadata<T> GetWorkbookMetadata<T>(IXLWorkbook workbook, I
{
var cell = worksheet.Row(1).Cell(poz);

if (string.IsNullOrEmpty(cell?.Value?.ToString()))
if (string.IsNullOrEmpty(cell?.Value.ToString()))
break;

poz += 1;
Expand Down Expand Up @@ -1658,7 +1656,7 @@ public static WorkbookMetadata<T> GetWorkbookMetadata<T>(IXLWorkbook workbook, I
{
var cell = localizedWorksheet.Row(1).Cell(poz);

if (string.IsNullOrEmpty(cell?.Value?.ToString()))
if (string.IsNullOrEmpty(cell?.Value.ToString()))
break;

poz += 1;
Expand Down Expand Up @@ -2166,7 +2164,7 @@ await _productService.GetTotalStockQuantityAsync(product) > 0 &&
.Select(categoryName => new CategoryKey(categoryName, storesIds))
.SelectAwait(async categoryKey =>
{
var rez = (allCategories.ContainsKey(categoryKey) ? allCategories[categoryKey].Id : allCategories.Values.FirstOrDefault(c => c.Name == categoryKey.Key)?.Id) ??
var rez = (allCategories.TryGetValue(categoryKey, out var value) ? value.Id : allCategories.Values.FirstOrDefault(c => c.Name == categoryKey.Key)?.Id) ??
allCategories.FirstOrDefault(p =>
p.Key.Key.Equals(categoryKey.Key, StringComparison.InvariantCultureIgnoreCase))
.Value?.Id;
Expand Down Expand Up @@ -2643,7 +2641,7 @@ public virtual async Task ImportCategoriesFromXlsxAsync(Stream stream)
{
var allColumnsAreEmpty = manager.GetDefaultProperties
.Select(property => defaultWorksheet.Row(iRow).Cell(property.PropertyOrderPosition))
.All(cell => string.IsNullOrEmpty(cell?.Value?.ToString()));
.All(cell => string.IsNullOrEmpty(cell?.Value.ToString()));

if (allColumnsAreEmpty)
break;
Expand Down
8 changes: 4 additions & 4 deletions src/Libraries/Nop.Services/Nop.Services.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Storage.Blobs" Version="12.14.1" />
<PackageReference Include="ClosedXML" Version="0.97.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.15.0" />
<PackageReference Include="ClosedXML" Version="0.100.3" />
<PackageReference Include="HarfBuzzSharp.NativeAssets.Linux" Version="2.8.2.3" />
<PackageReference Include="MailKit" Version="3.4.3" />
<PackageReference Include="MaxMind.GeoIP2" Version="5.1.0" />
<PackageReference Include="QuestPDF" Version="2022.11.0" />
<PackageReference Include="QuestPDF" Version="2022.12.1" />
<PackageReference Include="System.ServiceModel.Http" Version="4.10.0" />
<PackageReference Include="SkiaSharp" Version="2.88.3" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.3" />
<PackageReference Include="Svg.Skia" Version="0.5.18" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.23" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 4929895

Please sign in to comment.