From dfbaef615db7c27be7d5408534091afa138ea8ac Mon Sep 17 00:00:00 2001 From: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com> Date: Sun, 15 Oct 2023 19:21:40 +0200 Subject: [PATCH] refactor: Move usings to global file --- examples/WeatherForecast/Packages.props | 8 ++++---- .../src/WeatherForecast.Contexts/Usings.cs | 8 ++++++++ .../WeatherDataContext.cs | 6 ------ .../WeatherDataReadOnlyContext.cs | 9 --------- .../WeatherDataWriteOnlyContext.cs | 6 ------ .../src/WeatherForecast.Entities/HasId.cs | 5 ----- .../WeatherForecast.Entities/Temperature.cs | 4 ---- .../src/WeatherForecast.Entities/Usings.cs | 6 ++++++ .../WeatherForecast.Entities/WeatherData.cs | 6 ------ .../src/WeatherForecast.Interactors/Error.cs | 2 -- .../WeatherForecast.Interactors/Failure.cs | 2 -- .../WeatherForecast.Interactors/Failure`1.cs | 2 -- .../WeatherForecast.Interactors/ICommand.cs | 3 --- .../INotifyInteractorResult.cs | 3 --- .../WeatherForecast.Interactors/ResultInfo.cs | 2 -- .../ResultInfo`1.cs | 2 -- .../ISearchCityOrZipCode.cs | 4 ---- .../SearchCityOrZipCode.cs | 7 ------- .../WeatherForecast.Interactors/StatusCode.cs | 2 -- .../WeatherForecast.Interactors/Success.cs | 2 -- .../WeatherForecast.Interactors/Success`1.cs | 2 -- .../src/WeatherForecast.Interactors/Usings.cs | 6 ++++++ .../IWeatherDataReadOnlyRepository.cs | 6 ------ .../IWeatherDataWriteOnlyRepository.cs | 4 ---- .../WeatherForecast.Repositories/Usings.cs | 7 +++++++ .../WeatherDataReadOnlyRepository.cs | 10 +--------- .../WeatherDataWriteOnlyRepository.cs | 5 ----- .../Controllers/WeatherForecastController.cs | 9 --------- .../src/WeatherForecast/DatabaseContainer.cs | 5 ----- .../Pages/SevenDayWeatherForecast.razor | 13 +++++-------- .../src/WeatherForecast/Pages/_Host.cshtml | 1 - .../src/WeatherForecast/Program.cs | 19 ++++++------------- .../src/WeatherForecast/Usings.cs | 18 ++++++++++++++++++ .../src/WeatherForecast/_Imports.razor | 7 ++++++- .../WeatherForecast.InProcess.Tests/Usings.cs | 14 ++++++++++++++ .../WeatherForecastTest.cs | 15 --------------- .../tests/WeatherForecast.Tests/Usings.cs | 19 +++++++++++++++++++ .../WeatherForecastContainer.cs | 11 ----------- .../WeatherForecastImage.cs | 9 --------- .../WeatherForecastTest.cs | 15 ++------------- 40 files changed, 102 insertions(+), 182 deletions(-) create mode 100644 examples/WeatherForecast/src/WeatherForecast.Contexts/Usings.cs create mode 100644 examples/WeatherForecast/src/WeatherForecast.Entities/Usings.cs create mode 100644 examples/WeatherForecast/src/WeatherForecast.Interactors/Usings.cs create mode 100644 examples/WeatherForecast/src/WeatherForecast.Repositories/Usings.cs create mode 100644 examples/WeatherForecast/src/WeatherForecast/Usings.cs create mode 100644 examples/WeatherForecast/tests/WeatherForecast.InProcess.Tests/Usings.cs create mode 100644 examples/WeatherForecast/tests/WeatherForecast.Tests/Usings.cs diff --git a/examples/WeatherForecast/Packages.props b/examples/WeatherForecast/Packages.props index 6901fbc7c..0ddac7f44 100644 --- a/examples/WeatherForecast/Packages.props +++ b/examples/WeatherForecast/Packages.props @@ -2,13 +2,13 @@ - - - + + + - + diff --git a/examples/WeatherForecast/src/WeatherForecast.Contexts/Usings.cs b/examples/WeatherForecast/src/WeatherForecast.Contexts/Usings.cs new file mode 100644 index 000000000..687b1ea56 --- /dev/null +++ b/examples/WeatherForecast/src/WeatherForecast.Contexts/Usings.cs @@ -0,0 +1,8 @@ +global using System; +global using System.Collections.Generic; +global using System.Linq; +global using System.Threading.Tasks; +global using JetBrains.Annotations; +global using Microsoft.EntityFrameworkCore; +global using WeatherForecast.Entities; +global using WeatherForecast.Repositories; diff --git a/examples/WeatherForecast/src/WeatherForecast.Contexts/WeatherDataContext.cs b/examples/WeatherForecast/src/WeatherForecast.Contexts/WeatherDataContext.cs index b38b00a91..bf11cd842 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Contexts/WeatherDataContext.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Contexts/WeatherDataContext.cs @@ -1,9 +1,3 @@ -using System; -using System.Linq; -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; -using WeatherForecast.Entities; - namespace WeatherForecast.Contexts; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Contexts/WeatherDataReadOnlyContext.cs b/examples/WeatherForecast/src/WeatherForecast.Contexts/WeatherDataReadOnlyContext.cs index 3b27dc43e..019805d5c 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Contexts/WeatherDataReadOnlyContext.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Contexts/WeatherDataReadOnlyContext.cs @@ -1,12 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; -using WeatherForecast.Entities; -using WeatherForecast.Repositories; - namespace WeatherForecast.Contexts; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Contexts/WeatherDataWriteOnlyContext.cs b/examples/WeatherForecast/src/WeatherForecast.Contexts/WeatherDataWriteOnlyContext.cs index b2cec6eba..b8594403a 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Contexts/WeatherDataWriteOnlyContext.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Contexts/WeatherDataWriteOnlyContext.cs @@ -1,9 +1,3 @@ -using System; -using System.Threading.Tasks; -using JetBrains.Annotations; -using WeatherForecast.Entities; -using WeatherForecast.Repositories; - namespace WeatherForecast.Contexts; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Entities/HasId.cs b/examples/WeatherForecast/src/WeatherForecast.Entities/HasId.cs index 1297d5db5..ef67f9642 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Entities/HasId.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Entities/HasId.cs @@ -1,8 +1,3 @@ -using System; -using System.ComponentModel.DataAnnotations; -using System.Text.Json.Serialization; -using JetBrains.Annotations; - namespace WeatherForecast.Entities; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Entities/Temperature.cs b/examples/WeatherForecast/src/WeatherForecast.Entities/Temperature.cs index 13ad4a07a..e837162be 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Entities/Temperature.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Entities/Temperature.cs @@ -1,7 +1,3 @@ -using System; -using System.Text.Json.Serialization; -using JetBrains.Annotations; - namespace WeatherForecast.Entities; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Entities/Usings.cs b/examples/WeatherForecast/src/WeatherForecast.Entities/Usings.cs new file mode 100644 index 000000000..06532a6fc --- /dev/null +++ b/examples/WeatherForecast/src/WeatherForecast.Entities/Usings.cs @@ -0,0 +1,6 @@ +global using System; +global using System.Collections.Generic; +global using System.ComponentModel.DataAnnotations; +global using System.Linq; +global using System.Text.Json.Serialization; +global using JetBrains.Annotations; diff --git a/examples/WeatherForecast/src/WeatherForecast.Entities/WeatherData.cs b/examples/WeatherForecast/src/WeatherForecast.Entities/WeatherData.cs index 3ee86de7f..425578f71 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Entities/WeatherData.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Entities/WeatherData.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text.Json.Serialization; -using JetBrains.Annotations; - namespace WeatherForecast.Entities; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Interactors/Error.cs b/examples/WeatherForecast/src/WeatherForecast.Interactors/Error.cs index 57301d665..fe38e7670 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Interactors/Error.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Interactors/Error.cs @@ -1,5 +1,3 @@ -using JetBrains.Annotations; - namespace WeatherForecast.Interactors; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Interactors/Failure.cs b/examples/WeatherForecast/src/WeatherForecast.Interactors/Failure.cs index 3889f3ef9..43c4bdcba 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Interactors/Failure.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Interactors/Failure.cs @@ -1,5 +1,3 @@ -using JetBrains.Annotations; - namespace WeatherForecast.Interactors; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Interactors/Failure`1.cs b/examples/WeatherForecast/src/WeatherForecast.Interactors/Failure`1.cs index bb34a938e..7626a60ad 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Interactors/Failure`1.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Interactors/Failure`1.cs @@ -1,5 +1,3 @@ -using JetBrains.Annotations; - namespace WeatherForecast.Interactors; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Interactors/ICommand.cs b/examples/WeatherForecast/src/WeatherForecast.Interactors/ICommand.cs index 45a02b0a1..3dd4504d4 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Interactors/ICommand.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Interactors/ICommand.cs @@ -1,6 +1,3 @@ -using System.Threading.Tasks; -using JetBrains.Annotations; - namespace WeatherForecast.Interactors; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Interactors/INotifyInteractorResult.cs b/examples/WeatherForecast/src/WeatherForecast.Interactors/INotifyInteractorResult.cs index 5131c6290..dc8a51572 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Interactors/INotifyInteractorResult.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Interactors/INotifyInteractorResult.cs @@ -1,6 +1,3 @@ -using System; -using JetBrains.Annotations; - namespace WeatherForecast.Interactors; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Interactors/ResultInfo.cs b/examples/WeatherForecast/src/WeatherForecast.Interactors/ResultInfo.cs index c870f66bd..c7ee96230 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Interactors/ResultInfo.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Interactors/ResultInfo.cs @@ -1,5 +1,3 @@ -using JetBrains.Annotations; - namespace WeatherForecast.Interactors; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Interactors/ResultInfo`1.cs b/examples/WeatherForecast/src/WeatherForecast.Interactors/ResultInfo`1.cs index bc3f204ab..1c312516c 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Interactors/ResultInfo`1.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Interactors/ResultInfo`1.cs @@ -1,5 +1,3 @@ -using JetBrains.Annotations; - namespace WeatherForecast.Interactors; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Interactors/SearchCityOrZipCode/ISearchCityOrZipCode.cs b/examples/WeatherForecast/src/WeatherForecast.Interactors/SearchCityOrZipCode/ISearchCityOrZipCode.cs index cf365593d..d0e0a7654 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Interactors/SearchCityOrZipCode/ISearchCityOrZipCode.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Interactors/SearchCityOrZipCode/ISearchCityOrZipCode.cs @@ -1,7 +1,3 @@ -using System.Collections.Generic; -using JetBrains.Annotations; -using WeatherForecast.Entities; - namespace WeatherForecast.Interactors.SearchCityOrZipCode; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Interactors/SearchCityOrZipCode/SearchCityOrZipCode.cs b/examples/WeatherForecast/src/WeatherForecast.Interactors/SearchCityOrZipCode/SearchCityOrZipCode.cs index 775194e05..a0ca602e6 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Interactors/SearchCityOrZipCode/SearchCityOrZipCode.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Interactors/SearchCityOrZipCode/SearchCityOrZipCode.cs @@ -1,10 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using JetBrains.Annotations; -using WeatherForecast.Entities; -using WeatherForecast.Repositories; - namespace WeatherForecast.Interactors.SearchCityOrZipCode; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Interactors/StatusCode.cs b/examples/WeatherForecast/src/WeatherForecast.Interactors/StatusCode.cs index 7ebbd0aed..b7913eddb 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Interactors/StatusCode.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Interactors/StatusCode.cs @@ -1,5 +1,3 @@ -using JetBrains.Annotations; - namespace WeatherForecast.Interactors; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Interactors/Success.cs b/examples/WeatherForecast/src/WeatherForecast.Interactors/Success.cs index ab0a19260..f31df667e 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Interactors/Success.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Interactors/Success.cs @@ -1,5 +1,3 @@ -using JetBrains.Annotations; - namespace WeatherForecast.Interactors; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Interactors/Success`1.cs b/examples/WeatherForecast/src/WeatherForecast.Interactors/Success`1.cs index 441b6ffae..dee5f3e13 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Interactors/Success`1.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Interactors/Success`1.cs @@ -1,5 +1,3 @@ -using JetBrains.Annotations; - namespace WeatherForecast.Interactors; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Interactors/Usings.cs b/examples/WeatherForecast/src/WeatherForecast.Interactors/Usings.cs new file mode 100644 index 000000000..fae2fccb7 --- /dev/null +++ b/examples/WeatherForecast/src/WeatherForecast.Interactors/Usings.cs @@ -0,0 +1,6 @@ +global using System; +global using System.Collections.Generic; +global using System.Threading.Tasks; +global using JetBrains.Annotations; +global using WeatherForecast.Entities; +global using WeatherForecast.Repositories; diff --git a/examples/WeatherForecast/src/WeatherForecast.Repositories/IWeatherDataReadOnlyRepository.cs b/examples/WeatherForecast/src/WeatherForecast.Repositories/IWeatherDataReadOnlyRepository.cs index 05652411f..4cda8f47a 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Repositories/IWeatherDataReadOnlyRepository.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Repositories/IWeatherDataReadOnlyRepository.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using JetBrains.Annotations; -using WeatherForecast.Entities; - namespace WeatherForecast.Repositories; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Repositories/IWeatherDataWriteOnlyRepository.cs b/examples/WeatherForecast/src/WeatherForecast.Repositories/IWeatherDataWriteOnlyRepository.cs index 03d4ff08f..08106f10a 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Repositories/IWeatherDataWriteOnlyRepository.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Repositories/IWeatherDataWriteOnlyRepository.cs @@ -1,7 +1,3 @@ -using System.Threading.Tasks; -using JetBrains.Annotations; -using WeatherForecast.Entities; - namespace WeatherForecast.Repositories; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast.Repositories/Usings.cs b/examples/WeatherForecast/src/WeatherForecast.Repositories/Usings.cs new file mode 100644 index 000000000..79083b29c --- /dev/null +++ b/examples/WeatherForecast/src/WeatherForecast.Repositories/Usings.cs @@ -0,0 +1,7 @@ +global using System; +global using System.Collections.Generic; +global using System.Linq; +global using System.Threading; +global using System.Threading.Tasks; +global using JetBrains.Annotations; +global using WeatherForecast.Entities; diff --git a/examples/WeatherForecast/src/WeatherForecast.Repositories/WeatherDataReadOnlyRepository.cs b/examples/WeatherForecast/src/WeatherForecast.Repositories/WeatherDataReadOnlyRepository.cs index 52e9e7f82..150725bf7 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Repositories/WeatherDataReadOnlyRepository.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Repositories/WeatherDataReadOnlyRepository.cs @@ -1,17 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using JetBrains.Annotations; -using WeatherForecast.Entities; - namespace WeatherForecast.Repositories; [PublicAPI] public sealed class WeatherDataReadOnlyRepository : IWeatherDataReadOnlyRepository { - private static readonly ThreadLocal Random = new(() => new Random()); + private static readonly ThreadLocal Random = new ThreadLocal(() => new Random()); public Task> GetAllAsync() { diff --git a/examples/WeatherForecast/src/WeatherForecast.Repositories/WeatherDataWriteOnlyRepository.cs b/examples/WeatherForecast/src/WeatherForecast.Repositories/WeatherDataWriteOnlyRepository.cs index abdb755dd..bffc9ab76 100644 --- a/examples/WeatherForecast/src/WeatherForecast.Repositories/WeatherDataWriteOnlyRepository.cs +++ b/examples/WeatherForecast/src/WeatherForecast.Repositories/WeatherDataWriteOnlyRepository.cs @@ -1,8 +1,3 @@ -using System; -using System.Threading.Tasks; -using JetBrains.Annotations; -using WeatherForecast.Entities; - namespace WeatherForecast.Repositories; [PublicAPI] diff --git a/examples/WeatherForecast/src/WeatherForecast/Controllers/WeatherForecastController.cs b/examples/WeatherForecast/src/WeatherForecast/Controllers/WeatherForecastController.cs index 46c2aef93..bf92616ec 100644 --- a/examples/WeatherForecast/src/WeatherForecast/Controllers/WeatherForecastController.cs +++ b/examples/WeatherForecast/src/WeatherForecast/Controllers/WeatherForecastController.cs @@ -1,12 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using WeatherForecast.Entities; -using WeatherForecast.Interactors; -using WeatherForecast.Interactors.SearchCityOrZipCode; - namespace WeatherForecast.Controllers; [Route("api/[controller]")] diff --git a/examples/WeatherForecast/src/WeatherForecast/DatabaseContainer.cs b/examples/WeatherForecast/src/WeatherForecast/DatabaseContainer.cs index c6ab3834e..9f655a99d 100644 --- a/examples/WeatherForecast/src/WeatherForecast/DatabaseContainer.cs +++ b/examples/WeatherForecast/src/WeatherForecast/DatabaseContainer.cs @@ -1,8 +1,3 @@ -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Extensions.Hosting; -using Testcontainers.SqlEdge; - namespace WeatherForecast; public sealed class DatabaseContainer : IHostedService diff --git a/examples/WeatherForecast/src/WeatherForecast/Pages/SevenDayWeatherForecast.razor b/examples/WeatherForecast/src/WeatherForecast/Pages/SevenDayWeatherForecast.razor index 3da01ee0b..5eb7b1d8d 100644 --- a/examples/WeatherForecast/src/WeatherForecast/Pages/SevenDayWeatherForecast.razor +++ b/examples/WeatherForecast/src/WeatherForecast/Pages/SevenDayWeatherForecast.razor @@ -1,9 +1,3 @@ -@using System.Collections.Immutable -@using System.Collections.ObjectModel -@using System.Globalization -@using WeatherForecast.Entities -@using WeatherForecast.Interactors -@using WeatherForecast.Interactors.SearchCityOrZipCode @implements IDisposable @inject ISearchCityOrZipCode SearchCityOrZipCode @@ -12,8 +6,11 @@

Weather Forecast

- - + + + + + @{ diff --git a/examples/WeatherForecast/src/WeatherForecast/Pages/_Host.cshtml b/examples/WeatherForecast/src/WeatherForecast/Pages/_Host.cshtml index 3ecee3699..c1b3fc527 100644 --- a/examples/WeatherForecast/src/WeatherForecast/Pages/_Host.cshtml +++ b/examples/WeatherForecast/src/WeatherForecast/Pages/_Host.cshtml @@ -1,5 +1,4 @@ @page "/" -@using WeatherForecast @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @{ diff --git a/examples/WeatherForecast/src/WeatherForecast/Program.cs b/examples/WeatherForecast/src/WeatherForecast/Program.cs index 66df2e205..7f686b96e 100644 --- a/examples/WeatherForecast/src/WeatherForecast/Program.cs +++ b/examples/WeatherForecast/src/WeatherForecast/Program.cs @@ -1,18 +1,8 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Fast.Components.FluentUI; -using WeatherForecast; -using WeatherForecast.Contexts; -using WeatherForecast.Interactors.SearchCityOrZipCode; -using WeatherForecast.Repositories; - var builder = WebApplication.CreateBuilder(args); +builder.Services.AddFluentUIComponents(); +builder.Services.AddHttpClient(); builder.Services.AddRazorPages(); builder.Services.AddServerSideBlazor(); -builder.Services.AddHttpClient(); -builder.Services.AddFluentUIComponents(); var connectionString = builder.Configuration.GetConnectionString("DefaultConnection"); @@ -49,6 +39,9 @@ app.MapFallbackToPage("/_Host"); app.Run(); -public sealed partial class Program +namespace WeatherForecast { + public sealed class Program + { + } } diff --git a/examples/WeatherForecast/src/WeatherForecast/Usings.cs b/examples/WeatherForecast/src/WeatherForecast/Usings.cs new file mode 100644 index 000000000..d698b743e --- /dev/null +++ b/examples/WeatherForecast/src/WeatherForecast/Usings.cs @@ -0,0 +1,18 @@ +global using System; +global using System.Collections.Generic; +global using System.Threading; +global using System.Threading.Tasks; +global using Microsoft.AspNetCore.Builder; +global using Microsoft.AspNetCore.Mvc; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Hosting; +global using Microsoft.Fast.Components.FluentUI; +global using Testcontainers.SqlEdge; +global using WeatherForecast; +global using WeatherForecast.Contexts; +global using WeatherForecast.Entities; +global using WeatherForecast.Interactors; +global using WeatherForecast.Interactors.SearchCityOrZipCode; +global using WeatherForecast.Repositories; diff --git a/examples/WeatherForecast/src/WeatherForecast/_Imports.razor b/examples/WeatherForecast/src/WeatherForecast/_Imports.razor index 97b9f762f..f4515241a 100644 --- a/examples/WeatherForecast/src/WeatherForecast/_Imports.razor +++ b/examples/WeatherForecast/src/WeatherForecast/_Imports.razor @@ -1,3 +1,6 @@ +@using System.Collections.Immutable +@using System.Collections.ObjectModel +@using System.Globalization @using System.Net.Http @using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Components.Authorization @@ -7,5 +10,7 @@ @using Microsoft.AspNetCore.Components.Web.Virtualization @using Microsoft.Fast.Components.FluentUI @using Microsoft.JSInterop -@using WeatherForecast +@using WeatherForecast.Entities +@using WeatherForecast.Interactors +@using WeatherForecast.Interactors.SearchCityOrZipCode @using WeatherForecast.Shared diff --git a/examples/WeatherForecast/tests/WeatherForecast.InProcess.Tests/Usings.cs b/examples/WeatherForecast/tests/WeatherForecast.InProcess.Tests/Usings.cs new file mode 100644 index 000000000..467c50c3a --- /dev/null +++ b/examples/WeatherForecast/tests/WeatherForecast.InProcess.Tests/Usings.cs @@ -0,0 +1,14 @@ +global using System; +global using System.Collections.Generic; +global using System.Linq; +global using System.Net; +global using System.Net.Http; +global using System.Text.Json; +global using System.Threading.Tasks; +global using JetBrains.Annotations; +global using Microsoft.AspNetCore.Mvc.Testing; +global using Microsoft.Extensions.DependencyInjection; +global using Testcontainers.SqlEdge; +global using WeatherForecast.Entities; +global using WeatherForecast.Repositories; +global using Xunit; diff --git a/examples/WeatherForecast/tests/WeatherForecast.InProcess.Tests/WeatherForecastTest.cs b/examples/WeatherForecast/tests/WeatherForecast.InProcess.Tests/WeatherForecastTest.cs index f687637b8..9fd59002f 100644 --- a/examples/WeatherForecast/tests/WeatherForecast.InProcess.Tests/WeatherForecastTest.cs +++ b/examples/WeatherForecast/tests/WeatherForecast.InProcess.Tests/WeatherForecastTest.cs @@ -1,18 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Text.Json; -using System.Threading.Tasks; -using JetBrains.Annotations; -using Microsoft.AspNetCore.Mvc.Testing; -using Microsoft.Extensions.DependencyInjection; -using Testcontainers.SqlEdge; -using WeatherForecast.Entities; -using WeatherForecast.Repositories; -using Xunit; - namespace WeatherForecast.InProcess.Tests; [UsedImplicitly] diff --git a/examples/WeatherForecast/tests/WeatherForecast.Tests/Usings.cs b/examples/WeatherForecast/tests/WeatherForecast.Tests/Usings.cs new file mode 100644 index 000000000..c47d24b83 --- /dev/null +++ b/examples/WeatherForecast/tests/WeatherForecast.Tests/Usings.cs @@ -0,0 +1,19 @@ +global using System; +global using System.Collections.Generic; +global using System.Globalization; +global using System.IO; +global using System.Linq; +global using System.Net; +global using System.Net.Http; +global using System.Security.Cryptography.X509Certificates; +global using System.Text.Json; +global using System.Threading.Tasks; +global using DotNet.Testcontainers.Builders; +global using DotNet.Testcontainers.Containers; +global using DotNet.Testcontainers.Images; +global using DotNet.Testcontainers.Networks; +global using JetBrains.Annotations; +global using Testcontainers.SqlEdge; +global using WeatherForecast.Entities; +global using Xunit; +global using System.Threading; diff --git a/examples/WeatherForecast/tests/WeatherForecast.Tests/WeatherForecastContainer.cs b/examples/WeatherForecast/tests/WeatherForecast.Tests/WeatherForecastContainer.cs index cc8432770..646fbffb8 100644 --- a/examples/WeatherForecast/tests/WeatherForecast.Tests/WeatherForecastContainer.cs +++ b/examples/WeatherForecast/tests/WeatherForecast.Tests/WeatherForecastContainer.cs @@ -1,14 +1,3 @@ -using System; -using System.Net.Http; -using System.Security.Cryptography.X509Certificates; -using System.Threading.Tasks; -using DotNet.Testcontainers.Builders; -using DotNet.Testcontainers.Containers; -using DotNet.Testcontainers.Networks; -using JetBrains.Annotations; -using Testcontainers.SqlEdge; -using Xunit; - namespace WeatherForecast.Tests; [UsedImplicitly] diff --git a/examples/WeatherForecast/tests/WeatherForecast.Tests/WeatherForecastImage.cs b/examples/WeatherForecast/tests/WeatherForecast.Tests/WeatherForecastImage.cs index 426b4dc9c..cca88d969 100644 --- a/examples/WeatherForecast/tests/WeatherForecast.Tests/WeatherForecastImage.cs +++ b/examples/WeatherForecast/tests/WeatherForecast.Tests/WeatherForecastImage.cs @@ -1,12 +1,3 @@ -using System; -using System.Threading; -using System.Threading.Tasks; -using DotNet.Testcontainers.Builders; -using DotNet.Testcontainers.Containers; -using DotNet.Testcontainers.Images; -using JetBrains.Annotations; -using Xunit; - namespace WeatherForecast.Tests; [UsedImplicitly] diff --git a/examples/WeatherForecast/tests/WeatherForecast.Tests/WeatherForecastTest.cs b/examples/WeatherForecast/tests/WeatherForecast.Tests/WeatherForecastTest.cs index 007ff1eaa..558384232 100644 --- a/examples/WeatherForecast/tests/WeatherForecast.Tests/WeatherForecastTest.cs +++ b/examples/WeatherForecast/tests/WeatherForecast.Tests/WeatherForecastTest.cs @@ -1,19 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Net; -using System.Text.Json; -using System.Threading.Tasks; -using DotNet.Testcontainers.Builders; +namespace WeatherForecast.Tests; + using OpenQA.Selenium; using OpenQA.Selenium.Chrome; using OpenQA.Selenium.Support.UI; -using WeatherForecast.Entities; -using Xunit; - -namespace WeatherForecast.Tests; public static class WeatherForecastTest {