Skip to content

Commit

Permalink
refactor: add new operation claims with last id
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmet-cetinkaya committed Feb 15, 2024
1 parent a318378 commit 2cb34cb
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ [EnumeratorCancellation] CancellationToken cancellationToken
private async Task downloadStarterProject(string projectName)
{
// Download zip on url
string releaseUrl = "https://github.com/kodlamaio-projects/nArchitecture/archive/refs/tags/v1.1.0.zip";
string releaseUrl = "https://github.com/kodlamaio-projects/nArchitecture/archive/refs/tags/v1.1.1.zip";
using HttpClient client = new();
using HttpResponseMessage response = await client.GetAsync(releaseUrl);
response.EnsureSuccessStatusCode();
Expand All @@ -78,7 +78,7 @@ private async Task downloadStarterProject(string projectName)
ZipFile.ExtractToDirectory(zipPath, Environment.CurrentDirectory);
File.Delete(zipPath);
Directory.Move(
sourceDirName: $"{Environment.CurrentDirectory}/nArchitecture-1.1.0",
sourceDirName: $"{Environment.CurrentDirectory}/nArchitecture-1.1.1",
$"{Environment.CurrentDirectory}/{projectName}"
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Runtime.CompilerServices;
using Application.Features.Generate.Rules;
using Application.Features.Generate.Rules;
using Core.CodeGen.Code;
using Core.CodeGen.Code.CSharp;
using Core.CodeGen.File;
Expand All @@ -8,6 +7,7 @@
using Domain.Constants;
using Domain.ValueObjects;
using MediatR;
using System.Runtime.CompilerServices;

namespace Application.Features.Generate.Commands.Command;

Expand Down Expand Up @@ -134,10 +134,10 @@ await _templateEngine.RenderAsync(line, commandTemplateData)
await _templateEngine.RenderAsync(line, commandTemplateData)
)
);
await CSharpCodeInjector.AddCodeLinesToRegionAsync(
await CSharpCodeInjector.AddCodeLinesToMethodAsync(
operationClaimsEntityConfigurationFilePath,
commandOperationClaimSeedCodeLines,
featureName
"getFeatureOperationClaims",
commandOperationClaimSeedCodeLines
);

return new[] { featureOperationClaimFilePath, operationClaimsEntityConfigurationFilePath };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,11 @@ await _templateEngine.RenderAsync(line, QueryTemplateData)
string[] queryOperationClaimSeedCodeLines = await Task.WhenAll(
queryOperationClaimSeedTemplateCodeLines.Select(async line => await _templateEngine.RenderAsync(line, QueryTemplateData))
);
await CSharpCodeInjector.AddCodeLinesToRegionAsync(
await CSharpCodeInjector.AddCodeLinesToMethodAsync(
operationClaimsEntityConfigurationFilePath,
queryOperationClaimSeedCodeLines,
featureName
"getFeatureOperationClaims",
queryOperationClaimSeedCodeLines
);

return new[] { featureOperationClaimFilePath, operationClaimsEntityConfigurationFilePath };
}

Expand Down
2 changes: 1 addition & 1 deletion src/nArchGen/ConsoleUI/ConsoleUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageIcon>n-architecture-logo.png</PackageIcon>
<RepositoryUrl>https://github.com/kodlamaio-projects/nArchitecture.Gen</RepositoryUrl>
<PackageTags>nArchitecture, nArchGen, cli, framework, tool, code generation</PackageTags>
<Version>1.1.0</Version>
<Version>1.1.1</Version>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
public const string {{ command_name }} = "{{ feature_name | string.pascalcase }}.{{ command_name | string.pascalcase }}";
public const string {{ command_name }} = $"{_section}.{{ command_name | string.pascalcase }}";
Original file line number Diff line number Diff line change
@@ -1 +1 @@
public const string {{ query_name }} = "{{ feature_name | string.pascalcase }}.{{ query_name | string.pascalcase }}";
public const string {{ query_name }} = $"{_section}.{{ query_name | string.pascalcase }}";

0 comments on commit 2cb34cb

Please sign in to comment.