From 1598d0bbe1be1cc1d5fa947d3ff29b1ecdcf5e18 Mon Sep 17 00:00:00 2001 From: Viswanatha Swamy Date: Thu, 3 Dec 2020 18:35:28 +0530 Subject: [PATCH] Swamy/remove unused usings and reorganize usings (#489) * Removed and Reordered the using statements * Removed and Reordered the usings inside Web Project * Removed and Reordered the usings inside PublicApi project * Removed Unused usings and reorganized usings inside Infrastructure project --- src/Infrastructure/Data/OrderRepository.cs | 5 ++--- src/PublicApi/Program.cs | 1 - src/PublicApi/Startup.cs | 6 ++---- src/Web/Areas/Identity/IdentityHostingStartup.cs | 9 +-------- src/Web/Controllers/FileController.cs | 6 +++--- src/Web/Controllers/OrderController.cs | 1 - src/Web/Controllers/UserController.cs | 8 ++++---- src/Web/Program.cs | 1 - src/Web/Services/CachedCatalogViewModelService.cs | 8 ++++---- src/Web/Startup.cs | 14 +++++++------- src/Web/ViewModels/File/FileViewModel.cs | 7 +------ src/Web/Views/Manage/ManageNavPages.cs | 4 ++-- tests/FunctionalTests/PublicApi/ApiTokenHelper.cs | 1 - .../BasketRepositoryTests/SetQuantities.cs | 6 +++--- .../Repositories/OrderRepositoryTests/GetById.cs | 8 ++++---- .../Entities/CatalogItemTests/UpdateDetails.cs | 4 ++-- .../Entities/OrderTests/OrderTotal.cs | 2 +- .../Services/BasketServiceTests/SetQuantities.cs | 6 +++--- .../Specifications/BasketWithItemsSpecification.cs | 6 +++--- 19 files changed, 42 insertions(+), 61 deletions(-) diff --git a/src/Infrastructure/Data/OrderRepository.cs b/src/Infrastructure/Data/OrderRepository.cs index 7ab0954..c75d386 100644 --- a/src/Infrastructure/Data/OrderRepository.cs +++ b/src/Infrastructure/Data/OrderRepository.cs @@ -1,8 +1,7 @@ -using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate; +using Microsoft.EntityFrameworkCore; +using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate; using Microsoft.eShopWeb.ApplicationCore.Interfaces; -using Microsoft.EntityFrameworkCore; using System.Threading.Tasks; -using Ardalis.Specification; namespace Microsoft.eShopWeb.Infrastructure.Data { diff --git a/src/PublicApi/Program.cs b/src/PublicApi/Program.cs index 8ea3153..7be7805 100644 --- a/src/PublicApi/Program.cs +++ b/src/PublicApi/Program.cs @@ -7,7 +7,6 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using System; using System.Threading.Tasks; -using Microsoft.Extensions.Configuration; namespace Microsoft.eShopWeb.PublicApi { diff --git a/src/PublicApi/Startup.cs b/src/PublicApi/Startup.cs index ae00094..e2d4e19 100644 --- a/src/PublicApi/Startup.cs +++ b/src/PublicApi/Startup.cs @@ -1,9 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Text; using AutoMapper; using BlazorShared; -using BlazorShared.Authorization; using MediatR; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; @@ -23,6 +19,8 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.IdentityModel.Tokens; using Microsoft.OpenApi.Models; +using System.Collections.Generic; +using System.Text; namespace Microsoft.eShopWeb.PublicApi { diff --git a/src/Web/Areas/Identity/IdentityHostingStartup.cs b/src/Web/Areas/Identity/IdentityHostingStartup.cs index 57a55bd..ff8deb5 100644 --- a/src/Web/Areas/Identity/IdentityHostingStartup.cs +++ b/src/Web/Areas/Identity/IdentityHostingStartup.cs @@ -1,11 +1,4 @@ -using System; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Identity.UI; -using Microsoft.EntityFrameworkCore; -using Microsoft.eShopWeb.Infrastructure.Identity; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; +using Microsoft.AspNetCore.Hosting; [assembly: HostingStartup(typeof(Microsoft.eShopWeb.Web.Areas.Identity.IdentityHostingStartup))] namespace Microsoft.eShopWeb.Web.Areas.Identity diff --git a/src/Web/Controllers/FileController.cs b/src/Web/Controllers/FileController.cs index 088e905..1e3b9c3 100644 --- a/src/Web/Controllers/FileController.cs +++ b/src/Web/Controllers/FileController.cs @@ -1,8 +1,8 @@ -using System; -using System.IO; -using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.eShopWeb.Web.ViewModels.File; +using System; +using System.IO; namespace Microsoft.eShopWeb.Web.Controllers { diff --git a/src/Web/Controllers/OrderController.cs b/src/Web/Controllers/OrderController.cs index 4713a76..aa5b36a 100644 --- a/src/Web/Controllers/OrderController.cs +++ b/src/Web/Controllers/OrderController.cs @@ -1,5 +1,4 @@ using MediatR; -using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.eShopWeb.Web.Features.MyOrders; diff --git a/src/Web/Controllers/UserController.cs b/src/Web/Controllers/UserController.cs index 6770b34..37c34a7 100644 --- a/src/Web/Controllers/UserController.cs +++ b/src/Web/Controllers/UserController.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; +using BlazorShared.Authorization; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using BlazorShared.Authorization; using Microsoft.eShopWeb.ApplicationCore.Interfaces; +using System.Collections.Generic; +using System.Linq; +using System.Security.Claims; using System.Threading.Tasks; namespace Microsoft.eShopWeb.Web.Controllers diff --git a/src/Web/Program.cs b/src/Web/Program.cs index 15bdea5..7eb569b 100644 --- a/src/Web/Program.cs +++ b/src/Web/Program.cs @@ -7,7 +7,6 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using System; using System.Threading.Tasks; -using Microsoft.Extensions.Configuration; namespace Microsoft.eShopWeb.Web { diff --git a/src/Web/Services/CachedCatalogViewModelService.cs b/src/Web/Services/CachedCatalogViewModelService.cs index 86463b1..36345fa 100644 --- a/src/Web/Services/CachedCatalogViewModelService.cs +++ b/src/Web/Services/CachedCatalogViewModelService.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.eShopWeb.Web.Extensions; using Microsoft.eShopWeb.Web.ViewModels; using Microsoft.Extensions.Caching.Memory; -using Microsoft.eShopWeb.Web.Extensions; +using System.Collections.Generic; +using System.Threading.Tasks; namespace Microsoft.eShopWeb.Web.Services { diff --git a/src/Web/Startup.cs b/src/Web/Startup.cs index ee10b95..bca4c72 100644 --- a/src/Web/Startup.cs +++ b/src/Web/Startup.cs @@ -1,11 +1,18 @@ using Ardalis.ListStartupServices; +using BlazorAdmin; +using BlazorAdmin.Services; +using Blazored.LocalStorage; +using BlazorShared; +using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc.ApplicationModels; using Microsoft.EntityFrameworkCore; +using Microsoft.eShopWeb.ApplicationCore.Interfaces; using Microsoft.eShopWeb.Infrastructure.Data; using Microsoft.eShopWeb.Infrastructure.Identity; using Microsoft.eShopWeb.Web.Configuration; @@ -19,13 +26,6 @@ using System.IO; using System.Linq; using System.Net.Http; using System.Net.Mime; -using BlazorAdmin; -using BlazorAdmin.Services; -using Blazored.LocalStorage; -using Microsoft.AspNetCore.Authentication.Cookies; -using Microsoft.AspNetCore.DataProtection; -using Microsoft.eShopWeb.ApplicationCore.Interfaces; -using BlazorShared; namespace Microsoft.eShopWeb.Web { diff --git a/src/Web/ViewModels/File/FileViewModel.cs b/src/Web/ViewModels/File/FileViewModel.cs index bc0ec16..e139f13 100644 --- a/src/Web/ViewModels/File/FileViewModel.cs +++ b/src/Web/ViewModels/File/FileViewModel.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Microsoft.eShopWeb.Web.ViewModels.File +namespace Microsoft.eShopWeb.Web.ViewModels.File { public class FileViewModel { diff --git a/src/Web/Views/Manage/ManageNavPages.cs b/src/Web/Views/Manage/ManageNavPages.cs index 5f15b0d..a0b9bc5 100644 --- a/src/Web/Views/Manage/ManageNavPages.cs +++ b/src/Web/Views/Manage/ManageNavPages.cs @@ -1,6 +1,6 @@ -using System; -using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.ViewFeatures; +using System; namespace Microsoft.eShopWeb.Web.Views.Manage { diff --git a/tests/FunctionalTests/PublicApi/ApiTokenHelper.cs b/tests/FunctionalTests/PublicApi/ApiTokenHelper.cs index 5ddf62e..4b62754 100644 --- a/tests/FunctionalTests/PublicApi/ApiTokenHelper.cs +++ b/tests/FunctionalTests/PublicApi/ApiTokenHelper.cs @@ -1,5 +1,4 @@ using Microsoft.eShopWeb.ApplicationCore.Constants; -using Microsoft.eShopWeb.Infrastructure.Identity; using Microsoft.IdentityModel.Tokens; using System; using System.Collections.Generic; diff --git a/tests/IntegrationTests/Repositories/BasketRepositoryTests/SetQuantities.cs b/tests/IntegrationTests/Repositories/BasketRepositoryTests/SetQuantities.cs index 7093614..2720262 100644 --- a/tests/IntegrationTests/Repositories/BasketRepositoryTests/SetQuantities.cs +++ b/tests/IntegrationTests/Repositories/BasketRepositoryTests/SetQuantities.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate; using Microsoft.eShopWeb.ApplicationCore.Interfaces; using Microsoft.eShopWeb.ApplicationCore.Services; using Microsoft.eShopWeb.Infrastructure.Data; using Microsoft.eShopWeb.UnitTests.Builders; +using System.Collections.Generic; +using System.Threading.Tasks; using Xunit; namespace Microsoft.eShopWeb.IntegrationTests.Repositories.BasketRepositoryTests diff --git a/tests/IntegrationTests/Repositories/OrderRepositoryTests/GetById.cs b/tests/IntegrationTests/Repositories/OrderRepositoryTests/GetById.cs index 7991c29..85e53be 100644 --- a/tests/IntegrationTests/Repositories/OrderRepositoryTests/GetById.cs +++ b/tests/IntegrationTests/Repositories/OrderRepositoryTests/GetById.cs @@ -1,10 +1,10 @@ -using Microsoft.eShopWeb.Infrastructure.Data; -using Microsoft.EntityFrameworkCore; -using System.Linq; +using Microsoft.EntityFrameworkCore; +using Microsoft.eShopWeb.Infrastructure.Data; using Microsoft.eShopWeb.UnitTests.Builders; +using System.Linq; +using System.Threading.Tasks; using Xunit; using Xunit.Abstractions; -using System.Threading.Tasks; namespace Microsoft.eShopWeb.IntegrationTests.Repositories.OrderRepositoryTests { diff --git a/tests/UnitTests/ApplicationCore/Entities/CatalogItemTests/UpdateDetails.cs b/tests/UnitTests/ApplicationCore/Entities/CatalogItemTests/UpdateDetails.cs index d1d4600..3f767b9 100644 --- a/tests/UnitTests/ApplicationCore/Entities/CatalogItemTests/UpdateDetails.cs +++ b/tests/UnitTests/ApplicationCore/Entities/CatalogItemTests/UpdateDetails.cs @@ -1,6 +1,6 @@ -using Xunit; -using Microsoft.eShopWeb.ApplicationCore.Entities; +using Microsoft.eShopWeb.ApplicationCore.Entities; using System; +using Xunit; namespace Microsoft.eShopWeb.UnitTests.ApplicationCore.Entities.CatalogItemTests { diff --git a/tests/UnitTests/ApplicationCore/Entities/OrderTests/OrderTotal.cs b/tests/UnitTests/ApplicationCore/Entities/OrderTests/OrderTotal.cs index 8a6547d..709c00a 100644 --- a/tests/UnitTests/ApplicationCore/Entities/OrderTests/OrderTotal.cs +++ b/tests/UnitTests/ApplicationCore/Entities/OrderTests/OrderTotal.cs @@ -1,6 +1,6 @@ using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate; -using System.Collections.Generic; using Microsoft.eShopWeb.UnitTests.Builders; +using System.Collections.Generic; using Xunit; namespace Microsoft.eShopWeb.UnitTests.ApplicationCore.Entities.OrderTests diff --git a/tests/UnitTests/ApplicationCore/Services/BasketServiceTests/SetQuantities.cs b/tests/UnitTests/ApplicationCore/Services/BasketServiceTests/SetQuantities.cs index 4f47a20..27ae4b4 100644 --- a/tests/UnitTests/ApplicationCore/Services/BasketServiceTests/SetQuantities.cs +++ b/tests/UnitTests/ApplicationCore/Services/BasketServiceTests/SetQuantities.cs @@ -1,11 +1,11 @@ -using Microsoft.eShopWeb.ApplicationCore.Exceptions; +using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate; +using Microsoft.eShopWeb.ApplicationCore.Exceptions; using Microsoft.eShopWeb.ApplicationCore.Interfaces; using Microsoft.eShopWeb.ApplicationCore.Services; -using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate; using Moq; using System; -using Xunit; using System.Threading.Tasks; +using Xunit; namespace Microsoft.eShopWeb.UnitTests.ApplicationCore.Services.BasketServiceTests { diff --git a/tests/UnitTests/ApplicationCore/Specifications/BasketWithItemsSpecification.cs b/tests/UnitTests/ApplicationCore/Specifications/BasketWithItemsSpecification.cs index 048d504..2b6297a 100644 --- a/tests/UnitTests/ApplicationCore/Specifications/BasketWithItemsSpecification.cs +++ b/tests/UnitTests/ApplicationCore/Specifications/BasketWithItemsSpecification.cs @@ -1,10 +1,10 @@ -using Microsoft.eShopWeb.ApplicationCore.Specifications; +using Ardalis.Specification.EntityFrameworkCore; using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate; +using Microsoft.eShopWeb.ApplicationCore.Specifications; +using Moq; using System.Collections.Generic; using System.Linq; using Xunit; -using Moq; -using Ardalis.Specification.EntityFrameworkCore; namespace Microsoft.eShopWeb.UnitTests.ApplicationCore.Specifications {