Skip to content

Update language ext to v5 #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x
- name: Install dependencies
working-directory: ${{env.working-directory}}
run: dotnet restore
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x
- name: Install dependencies
working-directory: ${{env.working-directory}}
run: dotnet restore
Expand All @@ -56,7 +56,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x
- name: Install dependencies
working-directory: ${{env.working-directory}}
run: dotnet restore
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.8.0"/>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.core" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.11.0"/>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.core" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="Moq" Version="4.20.70" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>2.5.0</Version>
<Version>3.0.0-preview-8</Version>
<Description>A library contains common code related to ASP.NET Core.</Description>
<PackageProjectUrl>https://github.com/codehardth/Codehard.Common</PackageProjectUrl>
<RepositoryUrl>https://github.com/codehardth/Codehard.Common</RepositoryUrl>
Expand All @@ -17,7 +17,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.7.1" />
</ItemGroup>

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

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>3.0.0</Version>
Expand Down
9 changes: 8 additions & 1 deletion src/Codehard.Common/Codehard.Common.DomainModel/Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@
where TKey : struct
{
private readonly Action<object, string> lazyLoader;
private readonly List<IDomainEvent<TKey>> events = new();
private readonly List<IDomainEvent<TKey>> events = [];

/// <summary>
/// Initializes a new instance of the <see cref="Entity{TKey}"/> class.
/// </summary>
protected Entity()

Check warning on line 20 in src/Codehard.Common/Codehard.Common.DomainModel/Entity.cs

View workflow job for this annotation

GitHub Actions / build-and-test-common

Non-nullable field 'lazyLoader' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 20 in src/Codehard.Common/Codehard.Common.DomainModel/Entity.cs

View workflow job for this annotation

GitHub Actions / build-and-test-common

Non-nullable field 'lazyLoader' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 20 in src/Codehard.Common/Codehard.Common.DomainModel/Entity.cs

View workflow job for this annotation

GitHub Actions / build-and-test-infra

Non-nullable field 'lazyLoader' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
{
}

/// <summary>
/// Initializes a new instance of the <see cref="Entity{TKey}"/> class with a lazy loader.
/// </summary>
/// <param name="lazyLoader">The action responsible for loading navigation properties.</param>
protected Entity(Action<object, string> lazyLoader)
{
this.lazyLoader = lazyLoader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ public static IQueryable<T> Apply<T>(this IQueryable<T> query, IExpressionSpecif
}

/// <summary>
/// Logically AndAlso the <see cref="spec1"/> and <see cref="spec2"/>.
/// Logically AndAlso the <paramref name="spec1"/> and <paramref name="spec2"/>.
/// </summary>
/// <param name="spec1"></param>
/// <param name="spec2"></param>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
/// <param name="spec1">The first specification.</param>
/// <param name="spec2">The second specification.</param>
/// <typeparam name="T">The type of elements in the collection.</typeparam>
/// <returns>A new specification that represents the logical AndAlso of the two specifications.</returns>
public static IExpressionSpecification<T> And<T>(
this IExpressionSpecification<T> spec1,
IExpressionSpecification<T> spec2)
Expand Down Expand Up @@ -65,7 +65,7 @@ public static IExpressionSpecification<T> And<T>(
}

/// <summary>
/// Logically OrElse the <see cref="spec1"/> and <see cref="spec2"/>.
/// Logically OrElse the <paramref name="spec1"/> and <paramref name="spec2"/>.
/// </summary>
/// <param name="spec1"></param>
/// <param name="spec2"></param>
Expand Down Expand Up @@ -98,7 +98,7 @@ public static IExpressionSpecification<T> Or<T>(
}

/// <summary>
/// Logically Not the <see cref="spec"/>/>.
/// Logically Not the <paramref name="spec"/>.
/// </summary>
/// <param name="spec"></param>
/// <typeparam name="T"></typeparam>
Expand Down
19 changes: 1 addition & 18 deletions src/Codehard.Common/Codehard.Common.DomainModel/IEntity.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
namespace Codehard.Common.DomainModel;

[Obsolete]
public interface IEntityKey
{
}

/// <summary>
/// Generic interface for entities with a key of type TKey.
/// </summary>
/// <typeparam name="TKey">The type of the entity's key.</typeparam>
public interface IEntity<TKey> : IEntity
public interface IEntity<out TKey> : IEntity
where TKey : struct
{
/// <summary>
Expand All @@ -28,15 +23,3 @@ public interface IEntity
/// </summary>
IReadOnlyCollection<IDomainEvent> Events { get; }
}

[Obsolete]
public record struct IntegerKey(int Value) : IEntityKey;

[Obsolete]
public record struct LongKey(long Value) : IEntityKey;

[Obsolete]
public record struct StringKey(string Value) : IEntityKey;

[Obsolete]
public record struct GuidKey(Guid Value) : IEntityKey;
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace Codehard.Common.DomainModel;
public interface IRawQuerySpecification<in T> : ISpecification<T>
{
/// <summary>
/// Gets the raw query string.
/// </summary>
public string Query { get; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public interface IRepository<T> : IQueryable<T>
ValueTask<T?> GetByIdAsync(object[] id, CancellationToken cancellationToken = default);

/// <summary>
/// Queries a data using given <see cref="specification"/>.
/// Queries a data using given <paramref name="specification"/>.
/// </summary>
/// <param name="specification"></param>
/// <param name="cancellationToken"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Codehard.Common.DomainModel;
public interface ISpecification<in T>
{
/// <summary>
/// Verify if the <see cref="obj"/> is satisfied by this specification.
/// Verify if the <paramref name="obj"/> is satisfied by this specification.
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
namespace Codehard.Common.DomainModel;

/// <summary>
/// Represents a raw query specification for entities of type <typeparamref name="T"/>.
/// </summary>
/// <typeparam name="T">The type of the entity.</typeparam>
public abstract class RawQuerySpecification<T> : IRawQuerySpecification<T>
{
/// <summary>
/// Gets the raw query string.
/// </summary>
public string Query { get; }

/// <summary>
/// Initializes a new instance of the <see cref="RawQuerySpecification{T}"/> class with the specified query.
/// </summary>
/// <param name="query">The raw query string.</param>
protected RawQuerySpecification(string query)
{
this.Query = query;
}

/// <summary>
/// Determines whether the specified object satisfies the specification.
/// </summary>
/// <param name="obj">The object to test.</param>
/// <returns>Always throws a <see cref="NotSupportedException"/>.</returns>
/// <exception cref="NotSupportedException">Thrown always as this method is not supported.</exception>
public bool IsSatisfiedBy(T obj)
=> throw new NotSupportedException();
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.4.1"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion src/Codehard.Common/Codehard.Common/Codehard.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>3.0.0</Version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Runtime.Serialization;

namespace Codehard.Common.Exceptions;

/// <summary>
Expand All @@ -16,9 +14,4 @@ public ConfigurationMissingException(string configurationName)
: base($"Configuration '{configurationName}' is not set")
{
}

private ConfigurationMissingException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>

<LangVersion>11</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Basic.Reference.Assemblies" Version="1.4.5" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.8.0"/>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.core" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<PackageReference Include="Basic.Reference.Assemblies" Version="1.7.5" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.11.0"/>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.core" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Scriban" Version="5.9.0" />
<PackageReference Include="Scriban" Version="5.10.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>11.0</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<PackageId>Codehard.DomainModel.Generator</PackageId>
Expand All @@ -20,11 +19,11 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" PrivateAssets="all" />
<PackageReference Include="PolySharp" Version="1.14.0">
<PackageReference Include="PolySharp" Version="1.14.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Scriban" Version="5.9.0" PrivateAssets="all" GeneratePathProperty="true"/>
<PackageReference Include="Scriban" Version="5.10.0" PrivateAssets="all" GeneratePathProperty="true" />
</ItemGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ internal sealed record DomainEntityDefinition(
declaration.GetAllUsings()
.Select(u => u.Name.ToString())
.ToImmutableArray();

var @namespace = symbol.ContainingNamespace.GetSafeDisplayName();
var accessibility = symbol.DeclaredAccessibility;
var entityName = symbol.Name;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<Compile Include="ResultType.fs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="LanguageExt.Core" Version="4.4.7" />
<PackageReference Update="FSharp.Core" Version="7.0.402" />
<PackageReference Include="LanguageExt.Core" Version="5.0.0-beta-46" />
<PackageReference Update="FSharp.Core" Version="8.0.400" />
</ItemGroup>

</Project>
Loading
Loading