Skip to content

Commit ac947da

Browse files
Fixed: Compatibility issue with Intent.Common.CSharp version 3.9.8.
1 parent 7779825 commit ac947da

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

Modules/Intent.Modules.Entities.Constants/FactoryExtensions/TextConstraintFactoryExtension.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ private static void PatchValidator(IApplication application, string validatorTem
9999
var entityTemplate = application.FindTemplateInstance<ICSharpFileBuilderTemplate>(TemplateRoles.Domain.Entity.Primary, attributeModel.Class);
100100
var entityOutput = entityTemplate.CSharpFile.Classes.First();
101101

102-
var constant = entityOutput.Fields.FirstOrDefault(f => f.AccessModifier.Contains(" const") && f.TryGetMetadata<AttributeModel>("model", out var constAttributeModel) && constAttributeModel.Id == attributeModel.Id);
102+
var constant = entityOutput.Fields.FirstOrDefault(f =>
103+
(f.IsConstant || f.AccessModifier.Contains(" const") /* Need the .Contains check for backwards compatibility of older C# file builder */) &&
104+
f.TryGetMetadata<AttributeModel>("model", out var constAttributeModel) &&
105+
constAttributeModel.Id == attributeModel.Id);
103106
if (constant != null)
104107
{
105108
maxLengthStatement.Replace(new CSharpStatement($"MaximumLength( {entityTypeName}.{constant.Name} )"));

Modules/Intent.Modules.Entities.Constants/Intent.Entities.Constants.imodspec

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<package>
33
<id>Intent.Entities.Constants</id>
4-
<version>1.0.5</version>
5-
<supportedClientVersions>[4.3.0-a,5.0.0)</supportedClientVersions>
4+
<version>1.0.6-pre.0</version>
5+
<supportedClientVersions>[4.3.0-a, 5.0.0)</supportedClientVersions>
66
<summary>Module for introducing constants instead on numeric literals.</summary>
77
<description>Module for introducing constants instead on numeric literals.</description>
88
<tags>csharp dotnet domain entities entity</tags>
@@ -17,6 +17,7 @@
1717
<moduleSettings></moduleSettings>
1818
<dependencies>
1919
<dependency id="Intent.Common" version="3.6.0" />
20+
<dependency id="Intent.Common.CSharp" version="3.9.8-pre.0" />
2021
<dependency id="Intent.Common.Types" version="3.4.0" />
2122
<dependency id="Intent.Metadata.RDBMS" version="3.5.2" />
2223
<dependency id="Intent.Modelers.Domain" version="3.4.2" />

Modules/Intent.Modules.Entities.Constants/Intent.Modules.Entities.Constants.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Intent.Modules.Common.CSharp" Version="3.8.1" />
9+
<PackageReference Include="Intent.Modules.Common.CSharp" Version="3.9.8-pre.0" />
1010
<PackageReference Include="Intent.Modules.Metadata.RDBMS" Version="3.5.2" />
1111
<PackageReference Include="Intent.Modules.Modelers.Domain" Version="3.4.2" />
1212
<PackageReference Include="Intent.Modules.Modelers.Services" Version="3.4.2" />
@@ -15,8 +15,8 @@
1515
<PrivateAssets>all</PrivateAssets>
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1717
</PackageReference>
18-
<PackageReference Include="Intent.RoslynWeaver.Attributes" Version="2.1.7" />
19-
<PackageReference Include="Intent.SoftwareFactory.SDK" Version="3.7.0" />
18+
<PackageReference Include="Intent.RoslynWeaver.Attributes" Version="3.0.0" />
19+
<PackageReference Include="Intent.SoftwareFactory.SDK" Version="3.11.0-pre.1" />
2020
</ItemGroup>
2121

2222
<ItemGroup>

Modules/Intent.Modules.Entities.Constants/release-notes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### Version 1.0.6
2+
3+
- Fixed: Compatibility issue with `Intent.Common.CSharp` version 3.9.8.
4+
15
### Version 1.0.5
26

37
- Fixed: Increased `order` value for some `OnBuild(...)` method invocations to ensure they happen sufficiently after `OnBuild(...)` from other modules have been invoked.

0 commit comments

Comments
 (0)