Skip to content

Commit

Permalink
Added JsonConverters. (#9)
Browse files Browse the repository at this point in the history
* Added JsonConverters.

* Fix analyzer errors.

* Fixed tests.
  • Loading branch information
jscarle authored Apr 5, 2024
1 parent 090827f commit cab31b0
Show file tree
Hide file tree
Showing 13 changed files with 736 additions and 89 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,11 @@ jobs:
- name: Pack EntityFrameworkCore
run: dotnet pack ./src/LightResults.Extensions.EntityFrameworkCore/LightResults.Extensions.EntityFrameworkCore.csproj --configuration Release --no-build --output .

- name: Build Json
run: dotnet build ./src/LightResults.Extensions.Json/LightResults.Extensions.Json.csproj --configuration Release --no-restore

- name: Pack Json
run: dotnet pack ./src/LightResults.Extensions.Json/LightResults.Extensions.Json.csproj --configuration Release --no-build --output .

- name: Push to NuGet
run: dotnet nuget push "*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate
6 changes: 6 additions & 0 deletions LightResults.Extensions.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{A6C9FED0
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LightResults.Extensions.EntityFrameworkCore", "src\LightResults.Extensions.EntityFrameworkCore\LightResults.Extensions.EntityFrameworkCore.csproj", "{9FEADBCA-FD94-437D-9C98-79C673A84C10}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LightResults.Extensions.Json", "src\LightResults.Extensions.Json\LightResults.Extensions.Json.csproj", "{7628B10B-1D07-43BA-AC64-1DDF02A2A20F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -26,6 +28,10 @@ Global
{9FEADBCA-FD94-437D-9C98-79C673A84C10}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9FEADBCA-FD94-437D-9C98-79C673A84C10}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9FEADBCA-FD94-437D-9C98-79C673A84C10}.Release|Any CPU.Build.0 = Release|Any CPU
{7628B10B-1D07-43BA-AC64-1DDF02A2A20F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7628B10B-1D07-43BA-AC64-1DDF02A2A20F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7628B10B-1D07-43BA-AC64-1DDF02A2A20F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7628B10B-1D07-43BA-AC64-1DDF02A2A20F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{93C8BC67-7F34-4935-A671-F0B12AEDB072} = {A6C9FED0-42B6-488C-8961-DE13F291434B}
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ Extensions for [LightResults](https://github.com/jscarle/LightResults), an extre
[![nuget](https://img.shields.io/nuget/v/LightResults.Extensions.EntityFrameworkCore)](https://www.nuget.org/packages/LightResults.Extensions.EntityFrameworkCore)
[![downloads](https://img.shields.io/nuget/dt/LightResults.Extensions.EntityFrameworkCore)](https://www.nuget.org/packages/LightResults.Extensions.EntityFrameworkCore)

- [Json](https://jscarle.github.io/LightResults.Extensions/docs/json.html) - Provides System.Text.Json converters.

[![nuget](https://img.shields.io/nuget/v/LightResults.Extensions.Json)](https://www.nuget.org/packages/LightResults.Extensions.Json)
[![downloads](https://img.shields.io/nuget/dt/LightResults.Extensions.Json)](https://www.nuget.org/packages/LightResults.Extensions.Json)

## Documentation

Make sure to [read the docs](https://jscarle.github.io/LightResults.Extensions/) for the full API.
13 changes: 13 additions & 0 deletions docfx/docs/json.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Json

Provides System.Text.Json converters for LightResults.

[![main](https://img.shields.io/github/actions/workflow/status/jscarle/LightResults.Extensions/main.yml?logo=github)](https://github.com/jscarle/LightResults.Extensions)
[![nuget](https://img.shields.io/nuget/v/LightResults.Extensions.Json)](https://www.nuget.org/packages/LightResults.Extensions.Json)
[![downloads](https://img.shields.io/nuget/dt/LightResults.Extensions.Json)](https://www.nuget.org/packages/LightResults.Extensions.Json)

### Available converters

- `ResultJsonConverter`
- `ResultJsonConverter<TValue>`
- `ResultJsonConverterFactory`
4 changes: 4 additions & 0 deletions docfx/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ Extensions for [LightResults](https://github.com/jscarle/LightResults), an extre
[![nuget](https://img.shields.io/nuget/v/LightResults.Extensions.EntityFrameworkCore)](https://www.nuget.org/packages/LightResults.Extensions.EntityFrameworkCore)
[![downloads](https://img.shields.io/nuget/dt/LightResults.Extensions.EntityFrameworkCore)](https://www.nuget.org/packages/LightResults.Extensions.EntityFrameworkCore)

- [Json](https://jscarle.github.io/LightResults.Extensions/docs/json.html) - Provides System.Text.Json converters.

[![nuget](https://img.shields.io/nuget/v/LightResults.Extensions.Json)](https://www.nuget.org/packages/LightResults.Extensions.Json)
[![downloads](https://img.shields.io/nuget/dt/LightResults.Extensions.Json)](https://www.nuget.org/packages/LightResults.Extensions.Json)
Original file line number Diff line number Diff line change
@@ -1,61 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<!-- Compilation -->
<PropertyGroup>
<RootNamespace>LightResults.Extensions.EntityFrameworkCore</RootNamespace>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>LightResults.Extensions.EntityFrameworkCore</RootNamespace>
<LangVersion>latest</LangVersion>
<Version>8.0.0</Version>
<Title>LightResults.Extensions.EntityFrameworkCore</Title>
<Authors>Jean-Sebastien Carle</Authors>
<Description>EntityFrameworkCore with LightResults.</Description>
<Copyright>Copyright © Jean-Sebastien Carle 2024</Copyright>
<PackageId>LightResults.Extensions.EntityFrameworkCore</PackageId>
<PackageProjectUrl>https://github.com/jscarle/LightResults.Extensions</PackageProjectUrl>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>Icon.png</PackageIcon>
<RepositoryUrl>https://github.com/jscarle/LightResults.Extensions</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>result results pattern lightresults entityframework entityframeworkcore</PackageTags>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<FileVersion>8.0.0.0</FileVersion>
<NeutralLanguage>en-US</NeutralLanguage>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<!-- Analysis -->
<PropertyGroup>
<AnalysisLevel>latest-All</AnalysisLevel>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Optimize>true</Optimize>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>

<ItemGroup>
<InternalsVisibleTo Include="LightResults.Extensions.Tests"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="LightResults" Version="8.0.9"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
<None Include="..\..\LICENSE.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
<Visible>False</Visible>
</None>
<None Include="README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
<Visible>False</Visible>
</None>
<None Include="..\..\Icon.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
<Visible>False</Visible>
</None>
</ItemGroup>

<!-- References -->
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0"/>
</ItemGroup>
Expand All @@ -68,4 +28,50 @@
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="LightResults" Version="8.0.9"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>

<!-- Output -->
<PropertyGroup>
<AssemblyName>LightResults.Extensions.EntityFrameworkCore</AssemblyName>
<Version>8.0.0</Version>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<FileVersion>8.0.0.0</FileVersion>
<NeutralLanguage>en-US</NeutralLanguage>
<Optimize>true</Optimize>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>

<!-- Package -->
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>LightResults.Extensions.EntityFrameworkCore</PackageId>
<Title>LightResults.Extensions.EntityFrameworkCore</Title>
<Description>EntityFrameworkCore with LightResults.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageProjectUrl>https://github.com/jscarle/LightResults.Extensions</PackageProjectUrl>
<PackageTags>result results pattern lightresults entityframework entityframeworkcore</PackageTags>
<RepositoryUrl>https://github.com/jscarle/LightResults.Extensions</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Authors>Jean-Sebastien Carle</Authors>
<Copyright>Copyright © Jean-Sebastien Carle 2024</Copyright>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageIcon>Icon.png</PackageIcon>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\README.md" Pack="true" PackagePath="\" Visible="false"/>
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="\" Visible="false"/>
<None Include="..\..\Icon.png" Pack="true" PackagePath="\" Visible="false"/>
</ItemGroup>

<!-- Testing -->
<ItemGroup>
<InternalsVisibleTo Include="LightResults.Extensions.Tests"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,64 +1,70 @@
<Project Sdk="Microsoft.NET.Sdk">

<!-- Compilation -->
<PropertyGroup>
<RootNamespace>LightResults.Extensions.ExceptionHandling</RootNamespace>
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>LightResults.Extensions.ExceptionHandling</RootNamespace>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<!-- Analysis -->
<PropertyGroup>
<AnalysisLevel>latest-All</AnalysisLevel>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
</PropertyGroup>

<!-- References -->
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.0"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="LightResults" Version="8.0.9"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>

<!-- Output -->
<PropertyGroup>
<AssemblyName>LightResults.Extensions.ExceptionHandling</AssemblyName>
<Version>8.0.2</Version>
<AssemblyVersion>8.0.2.0</AssemblyVersion>
<FileVersion>8.0.2.0</FileVersion>
<NeutralLanguage>en-US</NeutralLanguage>
<Optimize>true</Optimize>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>

<!-- Package -->
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>LightResults.Extensions.ExceptionHandling</PackageId>
<Title>LightResults.Extensions.ExceptionHandling</Title>
<Authors>Jean-Sebastien Carle</Authors>
<Description>Exception handling for LightResults.</Description>
<Copyright>Copyright © Jean-Sebastien Carle 2024</Copyright>
<PackageId>LightResults.Extensions.ExceptionHandling</PackageId>
<PackageProjectUrl>https://github.com/jscarle/LightResults.Extensions</PackageProjectUrl>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>Icon.png</PackageIcon>
<PackageProjectUrl>https://github.com/jscarle/LightResults.Extensions</PackageProjectUrl>
<PackageTags>result results pattern lightresults exception handling</PackageTags>
<RepositoryUrl>https://github.com/jscarle/LightResults.Extensions</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>result results pattern lightresults exception handling</PackageTags>
<AssemblyVersion>8.0.2.0</AssemblyVersion>
<FileVersion>8.0.2.0</FileVersion>
<NeutralLanguage>en-US</NeutralLanguage>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<AnalysisLevel>latest-All</AnalysisLevel>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<Authors>Jean-Sebastien Carle</Authors>
<Copyright>Copyright © Jean-Sebastien Carle 2024</Copyright>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageIcon>Icon.png</PackageIcon>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible>
<Optimize>true</Optimize>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>

<ItemGroup>
<InternalsVisibleTo Include="LightResults.Extensions.Tests"/>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.0"/>
<None Include="..\..\README.md" Pack="true" PackagePath="\" Visible="false"/>
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="\" Visible="false"/>
<None Include="..\..\Icon.png" Pack="true" PackagePath="\" Visible="false"/>
</ItemGroup>

<!-- Testing -->
<ItemGroup>
<PackageReference Include="LightResults" Version="8.0.9"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
<None Include="..\..\LICENSE.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
<Visible>False</Visible>
</None>
<None Include="README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
<Visible>False</Visible>
</None>
<None Include="..\..\Icon.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
<Visible>False</Visible>
</None>
<InternalsVisibleTo Include="LightResults.Extensions.Tests"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<Project Sdk="Microsoft.NET.Sdk">

<!-- Compilation -->
<PropertyGroup>
<RootNamespace>LightResults.Extensions.Json</RootNamespace>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<!-- Analysis -->
<PropertyGroup>
<AnalysisLevel>latest-All</AnalysisLevel>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
</PropertyGroup>

<!-- References -->
<ItemGroup>
<PackageReference Include="LightResults" Version="8.0.9"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>

<!-- Output -->
<PropertyGroup>
<Version>8.0.0</Version>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<FileVersion>8.0.0.0</FileVersion>
<NeutralLanguage>en-US</NeutralLanguage>
<Optimize>true</Optimize>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>

<!-- Package -->
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>LightResults.Extensions.Json</PackageId>
<Title>LightResults.Extensions.Json</Title>
<Description>System.Text.Json converters for LightResults.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageProjectUrl>https://github.com/jscarle/LightResults.Extensions</PackageProjectUrl>
<PackageTags>result results pattern lightresults system-text-json json-converter</PackageTags>
<RepositoryUrl>https://github.com/jscarle/LightResults.Extensions</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Authors>Jean-Sebastien Carle</Authors>
<Copyright>Copyright © Jean-Sebastien Carle 2024</Copyright>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageIcon>Icon.png</PackageIcon>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\README.md" Pack="true" PackagePath="\" Visible="false"/>
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="\" Visible="false"/>
<None Include="..\..\Icon.png" Pack="true" PackagePath="\" Visible="false"/>
</ItemGroup>

<!-- Testing -->
<ItemGroup>
<InternalsVisibleTo Include="LightResults.Extensions.Tests"/>
</ItemGroup>

</Project>
Loading

0 comments on commit cab31b0

Please sign in to comment.