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.

Improvements/implicit usings (#582)

Guy Taggarc069d60ed0d1
diff --git a/src/Build/Grand.Common.props b/src/Build/Grand.Common.props
index 5a4556623..92cce046a 100644
--- a/src/Build/Grand.Common.props
+++ b/src/Build/Grand.Common.props
@@ -1,47 +1,44 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
+ <LangVersion>latest</LangVersion>
+ <ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>
<PropertyGroup>
<Product>grandnode</Product>
<PackageProjectUrl>https://grandnode.com/</PackageProjectUrl>
- <RepositoryUrl>https://github.com/grandnode/grandnode2</RepositoryUrl>
<PackageLicenseUrl>https://github.com/grandnode/grandnode2/blob/main/LICENSE</PackageLicenseUrl>
+ <RepositoryUrl>https://github.com/grandnode/grandnode2</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
- <LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugSymbols>false</DebugSymbols>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>
+
<ItemGroup>
- <Using Include="System" />
- <Using Include="System.Collections.Generic" />
- <Using Include="System.IO" />
- <Using Include="System.Text" />
- <Using Include="System.Linq" />
- <Using Include="System.Threading" />
- <Using Include="System.Threading.Tasks" />
+ <Using Include="System.Text"/>
</ItemGroup>
+
<Target Name="SetSourceRevisionId" BeforeTargets="InitializeSourceControlInformation"
Condition="'$(SourceRevisionId)'=='' And Exists('$(MSBuildProjectDirectory)\.git')">
<Exec Command="git describe --long --always --exclude=* --abbrev=8" ConsoleToMSBuild="True"
IgnoreExitCode="True">
- <Output PropertyName="SourceRevisionId" TaskParameter="ConsoleOutput" />
+ <Output PropertyName="SourceRevisionId" TaskParameter="ConsoleOutput"/>
</Exec>
</Target>
<Target Name="SetRepositoryBranch" BeforeTargets="InitializeSourceControlInformation"
Condition="'$(GitBranch)'=='' And Exists('$(MSBuildProjectDirectory)\.git')">
<Exec Command="git rev-parse --abbrev-ref HEAD" ConsoleToMSBuild="True" IgnoreExitCode="True">
- <Output PropertyName="branch" TaskParameter="ConsoleOutput" />
+ <Output PropertyName="branch" TaskParameter="ConsoleOutput"/>
</Exec>
<ItemGroup>
- <AssemblyMetadata Include="GitBranch" Value="$(branch)" />
+ <AssemblyMetadata Include="GitBranch" Value="$(branch)"/>
</ItemGroup>
</Target>
<ItemGroup Condition="'$(GitBranch)'!=''">
- <AssemblyMetadata Include="GitBranch" Value="$(GitBranch)" />
+ <AssemblyMetadata Include="GitBranch" Value="$(GitBranch)"/>
</ItemGroup>
<Target Name="SetVersion" BeforeTargets="PrepareForBuild">
<PropertyGroup>
diff --git a/src/Web/Grand.Web.Admin/Program.cs b/src/Web/Grand.Web.Admin/Program.cs
index 4538dfd91..7c7c724ba 100644
--- a/src/Web/Grand.Web.Admin/Program.cs
+++ b/src/Web/Grand.Web.Admin/Program.cs
@@ -1,7 +1,5 @@
-using Grand.Infrastructure;
-using Grand.Web.Common.Extensions;
-using Microsoft.AspNetCore.Builder;
-using Microsoft.Extensions.Hosting;
+using Grand.Web.Common.Extensions;
+using StartupBase = Grand.Infrastructure.StartupBase;
var builder = WebApplication.CreateBuilder(args);
diff --git a/src/Web/Grand.Web.Vendor/Program.cs b/src/Web/Grand.Web.Vendor/Program.cs
index 75c27be3a..0ec1da027 100644
--- a/src/Web/Grand.Web.Vendor/Program.cs
+++ b/src/Web/Grand.Web.Vendor/Program.cs
@@ -1,7 +1,5 @@
-using Grand.Infrastructure;
using Grand.Web.Common.Extensions;
-using Microsoft.AspNetCore.Builder;
-using Microsoft.Extensions.Hosting;
+using StartupBase = Grand.Infrastructure.StartupBase;
var builder = WebApplication.CreateBuilder(args);
diff --git a/src/Web/Grand.Web/Program.cs b/src/Web/Grand.Web/Program.cs
index 790a8c8e6..e9e212289 100644
--- a/src/Web/Grand.Web/Program.cs
+++ b/src/Web/Grand.Web/Program.cs
@@ -1,7 +1,5 @@
using Grand.Web.Common.Extensions;
using Grand.Web.Common.Startup;
-using Microsoft.AspNetCore.Builder;
-using Microsoft.Extensions.Hosting;
using StartupBase = Grand.Infrastructure.StartupBase;
var builder = WebApplication.CreateBuilder(args);