Skip to content

Commit d1cd82b

Browse files
authored
3.0.3: Enhancement: Upgraded package versions. (#25)
* 3.0.3: Upgraded package versions. * Minor performance enhancement: IDomainEventConfigurator.Args members are now readonly, to avoid defensive copies.
1 parent 9179e7a commit d1cd82b

File tree

6 files changed

+45
-44
lines changed

6 files changed

+45
-44
lines changed

DomainModeling.Generator/DomainModeling.Generator.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
</ItemGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
25+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
2626
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2727
<PrivateAssets>all</PrivateAssets>
2828
</PackageReference>
29-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" PrivateAssets="all" />
29+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.12.0" PrivateAssets="all" />
3030
</ItemGroup>
3131

3232
</Project>

DomainModeling.Generator/TypeSymbolExtensions.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ internal static class TypeSymbolExtensions
1010
{
1111
private const string ComparisonsNamespace = "Architect.DomainModeling.Comparisons";
1212

13-
private static IReadOnlyCollection<string> ConversionOperatorNames { get; } = new[]
14-
{
15-
"op_Implicit", "op_Explicit",
16-
};
13+
private static IReadOnlyCollection<string> ConversionOperatorNames { get; } = ["op_Implicit", "op_Explicit",];
1714

1815
/// <summary>
1916
/// Returns whether the <see cref="ITypeSymbol"/> is of type <typeparamref name="T"/>.
@@ -391,7 +388,7 @@ public static ITypeSymbol ExtractNonArrayElementType(this IArrayTypeSymbol array
391388
/// <summary>
392389
/// Returns whether the <see cref="ITypeSymbol"/> or a base type has an override of <see cref="Object.Equals(Object)"/> more specific than <see cref="Object"/>'s implementation.
393390
/// </summary>
394-
public static bool HasEqualsOverride(this ITypeSymbol typeSymbol, bool falseForStructs = false)
391+
public static bool HasEqualsOverride(this ITypeSymbol typeSymbol)
395392
{
396393
// Technically this could match an overridden "new" Equals defined by a base type, but that is a nonsense scenario
397394
var result = typeSymbol.GetMembers(nameof(Object.Equals)).OfType<IMethodSymbol>().Any(method => method.IsOverride && !method.IsStatic &&
@@ -623,7 +620,7 @@ public static string CreateComparisonExpression(this ITypeSymbol typeSymbol, str
623620
/// <param name="symbolName">The name of the member/parameter/... to instantiate an instance for. May be used as the dummy string value if applicable.</param>
624621
public static string CreateDummyInstantiationExpression(this ITypeSymbol typeSymbol, string symbolName)
625622
{
626-
return typeSymbol.CreateDummyInstantiationExpression(symbolName, Array.Empty<ITypeSymbol>(), _ => null!);
623+
return typeSymbol.CreateDummyInstantiationExpression(symbolName, [], _ => null!);
627624
}
628625

629626
/// <summary>
Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
1-
using Microsoft.CodeAnalysis.CSharp.Syntax;
2-
3-
namespace Architect.DomainModeling.Generator;
4-
5-
/// <summary>
6-
/// Provides extensions on <see cref="TypeSyntax"/>.
7-
/// </summary>
8-
internal static class TypeSyntaxExtensions
1+
using Microsoft.CodeAnalysis.CSharp.Syntax;
2+
3+
namespace Architect.DomainModeling.Generator;
4+
5+
/// <summary>
6+
/// Provides extensions on <see cref="TypeSyntax"/>.
7+
/// </summary>
8+
internal static class TypeSyntaxExtensions
99
{
1010
/// <summary>
1111
/// Returns whether the given <see cref="TypeSyntax"/> has the given arity (type parameter count) and (unqualified) name.
1212
/// </summary>
1313
/// <param name="arity">Pass null to accept any arity.</param>
14-
public static bool HasArityAndName(this TypeSyntax typeSyntax, int? arity, string unqualifiedName)
14+
public static bool HasArityAndName(this TypeSyntax typeSyntax, int? arity, string unqualifiedName)
1515
{
1616
return TryGetArityAndUnqualifiedName(typeSyntax, out var actualArity, out var actualUnqualifiedName) &&
1717
(arity is null || actualArity == arity) &&
18-
actualUnqualifiedName == unqualifiedName;
18+
actualUnqualifiedName == unqualifiedName;
1919
}
2020

2121
/// <summary>
2222
/// Returns whether the given <see cref="TypeSyntax"/> has the given arity (type parameter count) and (unqualified) name suffix.
2323
/// </summary>
2424
/// <param name="arity">Pass null to accept any arity.</param>
25-
public static bool HasArityAndNameSuffix(this TypeSyntax typeSyntax, int? arity, string unqualifiedName)
25+
public static bool HasArityAndNameSuffix(this TypeSyntax typeSyntax, int? arity, string unqualifiedName)
2626
{
2727
return TryGetArityAndUnqualifiedName(typeSyntax, out var actualArity, out var actualUnqualifiedName) &&
2828
(arity is null || actualArity == arity) &&
29-
actualUnqualifiedName.EndsWith(unqualifiedName);
29+
actualUnqualifiedName.EndsWith(unqualifiedName);
3030
}
3131

3232
private static bool TryGetArityAndUnqualifiedName(TypeSyntax typeSyntax, out int arity, out string unqualifiedName)
33-
{
34-
if (typeSyntax is SimpleNameSyntax simpleName)
35-
{
36-
arity = simpleName.Arity;
37-
unqualifiedName = simpleName.Identifier.ValueText;
38-
}
39-
else if (typeSyntax is QualifiedNameSyntax qualifiedName)
40-
{
41-
arity = qualifiedName.Arity;
42-
unqualifiedName = qualifiedName.Right.Identifier.ValueText;
43-
}
44-
else if (typeSyntax is AliasQualifiedNameSyntax aliasQualifiedName)
45-
{
46-
arity = aliasQualifiedName.Arity;
47-
unqualifiedName = aliasQualifiedName.Name.Identifier.ValueText;
33+
{
34+
if (typeSyntax is SimpleNameSyntax simpleName)
35+
{
36+
arity = simpleName.Arity;
37+
unqualifiedName = simpleName.Identifier.ValueText;
38+
}
39+
else if (typeSyntax is QualifiedNameSyntax qualifiedName)
40+
{
41+
arity = qualifiedName.Arity;
42+
unqualifiedName = qualifiedName.Right.Identifier.ValueText;
43+
}
44+
else if (typeSyntax is AliasQualifiedNameSyntax aliasQualifiedName)
45+
{
46+
arity = aliasQualifiedName.Arity;
47+
unqualifiedName = aliasQualifiedName.Name.Identifier.ValueText;
4848
}
4949
else
5050
{
@@ -68,5 +68,5 @@ private static bool TryGetArityAndUnqualifiedName(TypeSyntax typeSyntax, out int
6868
AliasQualifiedNameSyntax aliasQualifiedName => aliasQualifiedName.Name.Identifier.ValueText,
6969
_ => null,
7070
};
71-
}
72-
}
71+
}
72+
}

DomainModeling.Tests/DomainModeling.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
</PropertyGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
26-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0" />
27-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
28-
<PackageReference Include="xunit" Version="2.6.3" />
29-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
25+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
26+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.0" />
27+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
28+
<PackageReference Include="xunit" Version="2.9.3" />
29+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
3030
<PrivateAssets>all</PrivateAssets>
3131
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3232
</PackageReference>

DomainModeling/Configuration/IDomainEventConfigurator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ void ConfigureDomainEvent<
1818

1919
public readonly struct Args
2020
{
21-
public bool HasDefaultConstructor { get; init; }
21+
public readonly bool HasDefaultConstructor { get; init; }
2222
}
2323
}

DomainModeling/DomainModeling.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,18 @@
1717
</ItemGroup>
1818

1919
<PropertyGroup>
20-
<VersionPrefix>3.0.2</VersionPrefix>
20+
<VersionPrefix>3.0.3</VersionPrefix>
2121
<Description>
2222
A complete Domain-Driven Design (DDD) toolset for implementing domain models, including base types and source generators.
2323

2424
https://github.com/TheArchitectDev/Architect.DomainModeling
2525

2626
Release notes:
2727

28+
3.0.3:
29+
30+
- Enhancement: Upgraded package versions.
31+
2832
3.0.2:
2933

3034
- Bug fix.

0 commit comments

Comments
 (0)