Skip to content

Commit

Permalink
Move tests to net8.0 and cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
byme8 committed Jul 14, 2024
1 parent e6e1f3b commit 9bf0bbc
Show file tree
Hide file tree
Showing 13 changed files with 206 additions and 240 deletions.
1 change: 1 addition & 0 deletions src/Dapper.Json.Core/Dapper.Json.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<RootNamespace>Dapper.Json</RootNamespace>
</PropertyGroup>

</Project>
9 changes: 2 additions & 7 deletions src/Dapper.Json.Core/Json.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
namespace Dapper.Json;

public class Json<T>
public class Json<T>(T? value)
{
public Json(T? value)
{
Value = value;
}
public T? Value { get; } = value;

public T? Value { get; }

public static implicit operator Json<T>(T? value) => new(value);
}
3 changes: 2 additions & 1 deletion src/Dapper.Json.Newtonsoft/Dapper.Json.Newtonsoft.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
<TargetFramework>netstandard2.0</TargetFramework>
<PackageId>Apparatus.Dapper.Json.Newtonsoft</PackageId>
<Description>Enables the Newtonsoft.Json deserialization for Apparatus.Dapper.Json.</Description>
<RootNamespace>Dapper.Json</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<LangVersion>10</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3">
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
5 changes: 2 additions & 3 deletions src/Dapper.Json.SourceGenerator/DapperJsonSourceGenerator.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Collections.Immutable;
using System.Linq;
using System.Threading;
using DuckInterface;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;

Expand All @@ -13,7 +12,7 @@ public class DapperJsonSourceGenerator : IIncrementalGenerator
public void Initialize(IncrementalGeneratorInitializationContext context)
{
var jsonType = context.CompilationProvider
.Select((o, t) => o.GetTypeByMetadataName("Dapper.Json.Json`1"));
.Select((o, _) => o.GetTypeByMetadataName("Dapper.Json.Json`1"));

var jsons = context.SyntaxProvider
.CreateSyntaxProvider(SelectJsonT, Transform);
Expand Down Expand Up @@ -83,7 +82,7 @@ private ITypeSymbol Transform(GeneratorSyntaxContext context, CancellationToken

private bool SelectJsonT(SyntaxNode syntaxNode, CancellationToken token)
{
if (syntaxNode is GenericNameSyntax { Identifier.ValueText: "Json", } type)
if (syntaxNode is GenericNameSyntax { Identifier.ValueText: "Json", } _)
{
return true;
}
Expand Down

This file was deleted.

Loading

0 comments on commit 9bf0bbc

Please sign in to comment.