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

Update net9.0 #1120

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 2 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@ ipch/
# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

Expand Down Expand Up @@ -162,4 +155,5 @@ src/Modules/**/launchSettings.json
PublishProfiles/
logs/
src/Modules/**/wwwroot/admin/*.min.js
.vscode
.vscode
src/**/appsettings.Development.json
47 changes: 47 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<NoWarn>$(NoWarn);NU1507</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="AWSSDK.S3" Version="3.7.410.13" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.23.0" />
<PackageVersion Include="Braintree" Version="5.28.0" />
<PackageVersion Include="BuildBundlerMinifier" Version="3.2.449" />
<PackageVersion Include="cloudscribe.Web.Pagination" Version="8.0.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.3" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.3" />
<PackageVersion Include="DinkToPdf" Version="1.0.8" />
<PackageVersion Include="Humanizer" Version="2.14.1" />
<PackageVersion Include="IdentityServer4.AspNetIdentity" Version="4.1.2" />
<PackageVersion Include="MailKit" Version="4.9.0" />
<PackageVersion Include="MediatR" Version="12.4.1" />
<PackageVersion Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Facebook" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="MockQueryable.Moq" Version="7.0.3" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="ncrontab" Version="3.3.3" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Sendgrid" Version="9.29.3" />
<PackageVersion Include="Serilog.Extensions.Logging" Version="9.0.0" />
<PackageVersion Include="Serilog.Settings.Configuration" Version="9.0.0" />
<PackageVersion Include="Serilog.Sinks.RollingFile" Version="3.3.1-dev-00771" />
<PackageVersion Include="Stripe.net" Version="47.2.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="7.2.0" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.0",
"version": "9.0.0",
"rollForward": "latestMinor",
"allowPrerelease": false
}
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public IViewComponentResult Invoke(long? categoryId, IEnumerable<long> categoryI
}
else
{
var breadcrumbList = categoryIds.Select(Create).ToList();
List<IList<BreadcrumbViewModel>> breadcrumbList = categoryIds.Select(Create).ToList();
breadcrumbs = breadcrumbList.OrderByDescending(x => x.Count).First();
}

Expand All @@ -39,19 +39,19 @@ public IViewComponentResult Invoke(long? categoryId, IEnumerable<long> categoryI

private IList<BreadcrumbViewModel> Create(long categoryId)
{
var category = _categoryRepository
Category category = _categoryRepository
.Query()
.Include(x => x.Parent)
.FirstOrDefault(x => x.Id == categoryId);
var breadcrumbModels = new List<BreadcrumbViewModel>
List<BreadcrumbViewModel> breadcrumbModels = new List<BreadcrumbViewModel>
{
new BreadcrumbViewModel
{
Text = _contentLocalizationService.GetLocalizedProperty(category, nameof(category.Name), category.Name),
Url = category.Slug
}
};
var parentCategory = category.Parent;
Category parentCategory = category.Parent;
while (parentCategory != null)
{
breadcrumbModels.Insert(0, new BreadcrumbViewModel
Expand Down
29 changes: 12 additions & 17 deletions src/Modules/SimplCommerce.Module.Catalog/Models/Brand.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
using System.ComponentModel.DataAnnotations;
using SimplCommerce.Infrastructure.Models;

namespace SimplCommerce.Module.Catalog.Models
{
public class Brand : EntityBase
{
[Required(ErrorMessage = "The {0} field is required.")]
[StringLength(450)]
public string Name { get; set; }

[Required(ErrorMessage = "The {0} field is required.")]
[StringLength(450)]
public string Slug { get; set; }

public string Description { get; set; }
namespace SimplCommerce.Module.Catalog.Models;

public bool IsPublished { get; set; }

public bool IsDeleted { get; set; }
}
public class Brand : EntityBase
{
[Required(ErrorMessage = "The {0} field is required.")]
[StringLength(450)]
public string Name { get; set; }
[Required(ErrorMessage = "The {0} field is required.")]
[StringLength(450)]
public string Slug { get; set; }
public string Description { get; set; }
public bool IsPublished { get; set; }
public bool IsDeleted { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
using SimplCommerce.Module.Core.Services;

namespace SimplCommerce.Module.Catalog.Models
namespace SimplCommerce.Module.Catalog.Models;

public class CalculatedProductPrice
{
public class CalculatedProductPrice
private ICurrencyService _currencyService;
public CalculatedProductPrice(ICurrencyService currencyService)
{
private ICurrencyService _currencyService;

public CalculatedProductPrice(ICurrencyService currencyService)
{
_currencyService = currencyService;
}

public decimal Price { get; set; }

public decimal? OldPrice { get; set; }

public int PercentOfSaving { get; set; }

public string PriceString => _currencyService.FormatCurrency(Price);

public string OldPriceString => OldPrice.HasValue ? _currencyService.FormatCurrency(OldPrice.Value) : string.Empty;
_currencyService = currencyService;
}
public decimal Price { get; set; }
public decimal? OldPrice { get; set; }
public int PercentOfSaving { get; set; }
public string PriceString => _currencyService.FormatCurrency(Price);
public string OldPriceString => OldPrice.HasValue ? _currencyService.FormatCurrency(OldPrice.Value) : string.Empty;
}
59 changes: 22 additions & 37 deletions src/Modules/SimplCommerce.Module.Catalog/Models/Category.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,27 @@
using SimplCommerce.Infrastructure.Models;
using SimplCommerce.Module.Core.Models;

namespace SimplCommerce.Module.Catalog.Models
namespace SimplCommerce.Module.Catalog.Models;
public class Category : EntityBase
{
public class Category : EntityBase
{
[Required(ErrorMessage = "The {0} field is required.")]
[StringLength(450)]
public string Name { get; set; }

[Required(ErrorMessage = "The {0} field is required.")]
[StringLength(450)]
public string Slug { get; set; }

[StringLength(450)]
public string MetaTitle { get; set; }

[StringLength(450)]
public string MetaKeywords { get; set; }

public string MetaDescription { get; set; }

public string Description { get; set; }

public int DisplayOrder { get; set; }

public bool IsPublished { get; set; }

public bool IncludeInMenu { get; set; }

public bool IsDeleted { get; set; }

public long? ParentId { get; set; }

public Category Parent { get; set; }

public IList<Category> Children { get; protected set; } = new List<Category>();

public Media ThumbnailImage { get; set; }
}
[Required(ErrorMessage = "The {0} field is required.")]
[StringLength(450)]
public string Name { get; set; }
[Required(ErrorMessage = "The {0} field is required.")]
[StringLength(450)]
public string Slug { get; set; }
[StringLength(450)]
public string MetaTitle { get; set; }
[StringLength(450)]
public string MetaKeywords { get; set; }
public string MetaDescription { get; set; }
public string Description { get; set; }
public int DisplayOrder { get; set; }
public bool IsPublished { get; set; }
public bool IncludeInMenu { get; set; }
public bool IsDeleted { get; set; }
public long? ParentId { get; set; }
public Category Parent { get; set; }
public IList<Category> Children { get; protected set; } = new List<Category>();
public Media ThumbnailImage { get; set; }
}
Loading
Loading