Skip to content

Commit cd70683

Browse files
committed
Reformat
1 parent 604425a commit cd70683

File tree

115 files changed

+9545
-9545
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+9545
-9545
lines changed

Directory.Build.props

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22

3-
<PropertyGroup>
4-
<Copyright>(c) $([System.DateTime]::Now.Year), Pawel Gerr. All rights reserved.</Copyright>
5-
<VersionPrefix>8.0.0</VersionPrefix>
6-
<Authors>Pawel Gerr</Authors>
7-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
8-
<PackageProjectUrl>https://github.com/PawelGerr/Thinktecture.Runtime.Extensions</PackageProjectUrl>
9-
<PackageIcon>icon.png</PackageIcon>
10-
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
11-
<RepositoryType>git</RepositoryType>
12-
<RepositoryUrl>https://github.com/PawelGerr/Thinktecture.Runtime.Extensions</RepositoryUrl>
13-
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
14-
<RootNamespace>Thinktecture</RootNamespace>
15-
<TargetFramework>net7.0</TargetFramework>
16-
<LangVersion>13.0</LangVersion>
17-
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
18-
<Nullable>enable</Nullable>
19-
<ImplicitUsings>enable</ImplicitUsings>
20-
<NoWarn>$(NoWarn);CA1303;MSB3884;NETSDK1138;</NoWarn>
3+
<PropertyGroup>
4+
<Copyright>(c) $([System.DateTime]::Now.Year), Pawel Gerr. All rights reserved.</Copyright>
5+
<VersionPrefix>8.0.0</VersionPrefix>
6+
<Authors>Pawel Gerr</Authors>
7+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
8+
<PackageProjectUrl>https://github.com/PawelGerr/Thinktecture.Runtime.Extensions</PackageProjectUrl>
9+
<PackageIcon>icon.png</PackageIcon>
10+
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
11+
<RepositoryType>git</RepositoryType>
12+
<RepositoryUrl>https://github.com/PawelGerr/Thinktecture.Runtime.Extensions</RepositoryUrl>
13+
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
14+
<RootNamespace>Thinktecture</RootNamespace>
15+
<TargetFramework>net7.0</TargetFramework>
16+
<LangVersion>13.0</LangVersion>
17+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
18+
<Nullable>enable</Nullable>
19+
<ImplicitUsings>enable</ImplicitUsings>
20+
<NoWarn>$(NoWarn);CA1303;MSB3884;NETSDK1138;</NoWarn>
2121

22-
<VSTestLogger>trx%3bLogFileName=$(MSBuildProjectName).trx</VSTestLogger>
23-
<VSTestResultsDirectory>$(MSBuildThisFileDirectory)test-results/$(TargetFramework)</VSTestResultsDirectory>
24-
</PropertyGroup>
22+
<VSTestLogger>trx%3bLogFileName=$(MSBuildProjectName).trx</VSTestLogger>
23+
<VSTestResultsDirectory>$(MSBuildThisFileDirectory)test-results/$(TargetFramework)</VSTestResultsDirectory>
24+
</PropertyGroup>
2525

2626
</Project>

README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
![TestResults](https://gist.githubusercontent.com/PawelGerr/043909cfb348b36187d02222da1f372e/raw/badge.svg)
33
![NuGet Downloads](https://img.shields.io/nuget/dt/Thinktecture.Runtime.Extensions)
44

5-
65
[![Thinktecture.Runtime.Extensions](https://img.shields.io/nuget/v/Thinktecture.Runtime.Extensions.svg?maxAge=60&label=Thinktecture.Runtime.Extensions)](https://www.nuget.org/packages/Thinktecture.Runtime.Extensions/)
76
[![Thinktecture.Runtime.Extensions.EntityFrameworkCore6](https://img.shields.io/nuget/v/Thinktecture.Runtime.Extensions.EntityFrameworkCore6.svg?maxAge=60&label=Thinktecture.Runtime.Extensions.EntityFrameworkCore6)](https://www.nuget.org/packages/Thinktecture.Runtime.Extensions.EntityFrameworkCore6/)
87
[![Thinktecture.Runtime.Extensions.EntityFrameworkCore7](https://img.shields.io/nuget/v/Thinktecture.Runtime.Extensions.EntityFrameworkCore7.svg?maxAge=60&label=Thinktecture.Runtime.Extensions.EntityFrameworkCore7)](https://www.nuget.org/packages/Thinktecture.Runtime.Extensions.EntityFrameworkCore7/)
@@ -20,8 +19,8 @@ This library provides some interfaces, classes, [Roslyn Source Generators](https
2019
* [Smart Enum](#smart-enums)
2120
* [Value Objects](#value-objects)
2221
* [Discriminated Unions](#discriminated-unions) (requires version 8.x.x)
23-
* [Ad hoc unions](#ad-hoc-unions)
24-
* [Regular unions](#regular-unions)
22+
* [Ad hoc unions](#ad-hoc-unions)
23+
* [Regular unions](#regular-unions)
2524

2625
# Documentation
2726

@@ -30,22 +29,25 @@ See [wiki](https://github.com/PawelGerr/Thinktecture.Runtime.Extensions/wiki) fo
3029
## **[Ideas and real-world use cases](https://github.com/PawelGerr/Thinktecture.Runtime.Extensions/wiki/Value-Objects#real-world-use-cases-and-ideas)**
3130

3231
Smart Enums:
32+
3333
* [CSV-Importer-Type](https://github.com/PawelGerr/Thinktecture.Runtime.Extensions/wiki/Smart-Enums#csv-importer-type)
3434

3535
Value objects:
36+
3637
* [Open-ended End Date](https://github.com/PawelGerr/Thinktecture.Runtime.Extensions/wiki/Value-Objects#open-ended-end-date)
3738
* [(Always-positive) Amount](https://github.com/PawelGerr/Thinktecture.Runtime.Extensions/wiki/Value-Objects#always-positive-amount)
3839

3940
# Requirements
4041

4142
* Version 8:
42-
* C# 11 (or higher) for generated code
43-
* SDK 8.0.400 (or higher) for building projects
43+
* C# 11 (or higher) for generated code
44+
* SDK 8.0.400 (or higher) for building projects
4445
* Version 7:
45-
* C# 11 (or higher) for generated code
46-
* SDK 7.0.401 (or higher) for building projects
46+
* C# 11 (or higher) for generated code
47+
* SDK 7.0.401 (or higher) for building projects
4748

4849
# Migrations
50+
4951
* [Migration from v7 to v8](https://github.com/PawelGerr/Thinktecture.Runtime.Extensions/wiki/Migration-from-v7-to-v8)
5052
* [Migration from v6 to v7](https://github.com/PawelGerr/Thinktecture.Runtime.Extensions/wiki/Migration-from-v6-to-v7)
5153

@@ -56,6 +58,7 @@ Install: `Install-Package Thinktecture.Runtime.Extensions`
5658
Documentation: [Smart Enums](https://github.com/PawelGerr/Thinktecture.Runtime.Extensions/wiki/Smart-Enums)
5759

5860
Features:
61+
5962
* Roslyn Analyzers and CodeFixes help the developers to implement the Smart Enums correctly
6063
* [Allows iteration over all items](https://github.com/PawelGerr/Thinktecture.Runtime.Extensions/wiki/Smart-Enums#what-is-implemented-for-you)
6164
* [Allows custom properties and methods](https://github.com/PawelGerr/Thinktecture.Runtime.Extensions/wiki/Smart-Enums#custom-fields-properties-and-methods)
@@ -259,6 +262,7 @@ Install: `Install-Package Thinktecture.Runtime.Extensions`
259262
Documentation: [Value Objects](https://github.com/PawelGerr/Thinktecture.Runtime.Extensions/wiki/Value-Objects)
260263

261264
Features:
265+
262266
* Roslyn Analyzers and CodeFixes help the developers to implement the Value Objects correctly
263267
* Choice between [Simple Value Objects](https://github.com/PawelGerr/Thinktecture.Runtime.Extensions/wiki/Value-Objects#simple-value-objects) and [Complex Value Objects](https://github.com/PawelGerr/Thinktecture.Runtime.Extensions/wiki/Value-Objects#complex-value-objects)
264268
* Allows custom fields, properties and methods
@@ -475,6 +479,7 @@ There are 2 types of unions: `ad hoc union` and `"regular" unions`
475479
## Ad hoc unions
476480

477481
Features:
482+
478483
* Roslyn Analyzers and CodeFixes help the developers to implement the unions correctly
479484
* Provides proper implementation of `Equals`, `GetHashCode`, `ToString` and equality comparison via `==` and `!=`
480485
* Switch-Case/Map
@@ -588,17 +593,19 @@ int number = textOrNumberFromInt.AsNumber;
588593
textOrNumberFromString.Switch(text: s => logger.Information("[Switch] String Action: {Text}", s),
589594
number: i => logger.Information("[Switch] Int Action: {Number}", i));
590595
```
591-
596+
592597
## Regular unions
593598

594599
Features:
600+
595601
* Roslyn Analyzers and CodeFixes help the developers to implement the unions correctly
596602
* Can be a `class` or `record`
597603
* Switch-Case/Map
598604
* Supports generics
599605
* Derived types can be simple classes or something complex like a [value object](#value-objects).
600606

601607
Simple union using a class and a value object:
608+
602609
```csharp
603610
[Union]
604611
public partial class Animal
@@ -642,7 +649,7 @@ public partial class Animal
642649
}
643650
```
644651

645-
A `record` with a generic:
652+
A `record` with a generic:
646653

647654
```csharp
648655
[Union]

samples/Directory.Build.props

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22

3-
<PropertyGroup>
4-
<ParentPropsFile>$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))</ParentPropsFile>
5-
</PropertyGroup>
3+
<PropertyGroup>
4+
<ParentPropsFile>$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))</ParentPropsFile>
5+
</PropertyGroup>
66

7-
<Import Condition=" exists('$(ParentPropsFile)') " Project="$(ParentPropsFile)" />
7+
<Import Condition=" exists('$(ParentPropsFile)') " Project="$(ParentPropsFile)" />
88

9-
<PropertyGroup>
10-
<TargetFramework>net9.0</TargetFramework>
11-
<NoWarn>$(NoWarn);CS1591;CA1052;CA1062;CA1303;CA1707;CA1801;CA2000;NU1903</NoWarn>
12-
<IsPackable>false</IsPackable>
13-
<ImplicitUsings>disable</ImplicitUsings>
14-
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
15-
<ThinktectureRuntimeExtensions_SourceGenerator_LogFilePathMustBeUnique>false</ThinktectureRuntimeExtensions_SourceGenerator_LogFilePathMustBeUnique>
16-
<ThinktectureRuntimeExtensions_SourceGenerator_LogFilePath>C:\temp\ttre_samples_logs.txt</ThinktectureRuntimeExtensions_SourceGenerator_LogFilePath>
17-
</PropertyGroup>
9+
<PropertyGroup>
10+
<TargetFramework>net9.0</TargetFramework>
11+
<NoWarn>$(NoWarn);CS1591;CA1052;CA1062;CA1303;CA1707;CA1801;CA2000;NU1903</NoWarn>
12+
<IsPackable>false</IsPackable>
13+
<ImplicitUsings>disable</ImplicitUsings>
14+
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
15+
<ThinktectureRuntimeExtensions_SourceGenerator_LogFilePathMustBeUnique>false</ThinktectureRuntimeExtensions_SourceGenerator_LogFilePathMustBeUnique>
16+
<ThinktectureRuntimeExtensions_SourceGenerator_LogFilePath>C:\temp\ttre_samples_logs.txt</ThinktectureRuntimeExtensions_SourceGenerator_LogFilePath>
17+
</PropertyGroup>
1818

19-
<ItemGroup>
20-
<CompilerVisibleProperty Include="ThinktectureRuntimeExtensions_SourceGenerator_Counter" />
21-
<CompilerVisibleProperty Include="ThinktectureRuntimeExtensions_SourceGenerator_LogFilePath" />
22-
<CompilerVisibleProperty Include="ThinktectureRuntimeExtensions_SourceGenerator_LogFilePathMustBeUnique" />
23-
<CompilerVisibleProperty Include="ThinktectureRuntimeExtensions_SourceGenerator_LogLevel" />
24-
<CompilerVisibleProperty Include="ThinktectureRuntimeExtensions_SourceGenerator_LogMessageInitialBufferSize" />
25-
</ItemGroup>
19+
<ItemGroup>
20+
<CompilerVisibleProperty Include="ThinktectureRuntimeExtensions_SourceGenerator_Counter" />
21+
<CompilerVisibleProperty Include="ThinktectureRuntimeExtensions_SourceGenerator_LogFilePath" />
22+
<CompilerVisibleProperty Include="ThinktectureRuntimeExtensions_SourceGenerator_LogFilePathMustBeUnique" />
23+
<CompilerVisibleProperty Include="ThinktectureRuntimeExtensions_SourceGenerator_LogLevel" />
24+
<CompilerVisibleProperty Include="ThinktectureRuntimeExtensions_SourceGenerator_LogMessageInitialBufferSize" />
25+
</ItemGroup>
2626

2727
</Project>

samples/Newtonsoft.Json.AspNetCore.Samples/Program.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,20 @@ private static Task StartServerAsync(ILoggerFactory loggerFactory)
8181
{
8282
var webHost = new HostBuilder()
8383
.ConfigureWebHostDefaults(builder =>
84-
{
85-
builder.UseKestrel()
86-
.Configure(app =>
87-
{
88-
app.UseRouting();
89-
app.UseEndpoints(endpoints => endpoints.MapControllers());
90-
});
91-
})
84+
{
85+
builder.UseKestrel()
86+
.Configure(app =>
87+
{
88+
app.UseRouting();
89+
app.UseEndpoints(endpoints => endpoints.MapControllers());
90+
});
91+
})
9292
.ConfigureServices(collection =>
93-
{
94-
collection.AddSingleton(loggerFactory);
95-
collection.AddControllers(options => options.ModelBinderProviders.Insert(0, new ValueObjectModelBinderProvider()))
96-
.AddNewtonsoftJson(options => options.SerializerSettings.Converters.Add(new ValueObjectNewtonsoftJsonConverter()));
97-
})
93+
{
94+
collection.AddSingleton(loggerFactory);
95+
collection.AddControllers(options => options.ModelBinderProviders.Insert(0, new ValueObjectModelBinderProvider()))
96+
.AddNewtonsoftJson(options => options.SerializerSettings.Converters.Add(new ValueObjectNewtonsoftJsonConverter()));
97+
})
9898
.Build();
9999

100100
return webHost.RunAsync();
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
2-
<PropertyGroup>
3-
<OutputType>EXE</OutputType>
4-
<NoWarn>$(NoWarn);CA2007;CA2234</NoWarn>
5-
</PropertyGroup>
6-
<ItemGroup>
7-
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" />
8-
<PackageReference Include="Serilog.Extensions.Logging" />
9-
<PackageReference Include="Serilog.Sinks.Console" />
10-
</ItemGroup>
11-
<ItemGroup>
12-
<ProjectReference Include="..\..\src\Thinktecture.Runtime.Extensions.AspNetCore\Thinktecture.Runtime.Extensions.AspNetCore.csproj" />
13-
<ProjectReference Include="..\..\src\Thinktecture.Runtime.Extensions.Newtonsoft.Json\Thinktecture.Runtime.Extensions.Newtonsoft.Json.csproj" />
14-
<ProjectReference Include="..\Thinktecture.Runtime.Extensions.Samples\Thinktecture.Runtime.Extensions.Samples.csproj" />
15-
<ProjectReference Include="..\..\src\Thinktecture.Runtime.Extensions.SourceGenerator\Thinktecture.Runtime.Extensions.SourceGenerator.csproj" SetTargetFramework="TargetFramework=netstandard2.0" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
16-
</ItemGroup>
2+
<PropertyGroup>
3+
<OutputType>EXE</OutputType>
4+
<NoWarn>$(NoWarn);CA2007;CA2234</NoWarn>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" />
8+
<PackageReference Include="Serilog.Extensions.Logging" />
9+
<PackageReference Include="Serilog.Sinks.Console" />
10+
</ItemGroup>
11+
<ItemGroup>
12+
<ProjectReference Include="..\..\src\Thinktecture.Runtime.Extensions.AspNetCore\Thinktecture.Runtime.Extensions.AspNetCore.csproj" />
13+
<ProjectReference Include="..\..\src\Thinktecture.Runtime.Extensions.Newtonsoft.Json\Thinktecture.Runtime.Extensions.Newtonsoft.Json.csproj" />
14+
<ProjectReference Include="..\Thinktecture.Runtime.Extensions.Samples\Thinktecture.Runtime.Extensions.Samples.csproj" />
15+
<ProjectReference Include="..\..\src\Thinktecture.Runtime.Extensions.SourceGenerator\Thinktecture.Runtime.Extensions.SourceGenerator.csproj" SetTargetFramework="TargetFramework=netstandard2.0" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
16+
</ItemGroup>
1717
</Project>

0 commit comments

Comments
 (0)