Skip to content

Commit

Permalink
Resolve #74.
Browse files Browse the repository at this point in the history
  • Loading branch information
chullybun committed Sep 25, 2020
1 parent a01222a commit d1cca5e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tools/Beef.CodeGen.Core/Beef.CodeGen.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>Beef.CodeGen</RootNamespace>
<Version>4.1.3</Version>
<Version>4.1.4</Version>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<ApplicationIcon />
<StartupObject />
Expand Down
3 changes: 3 additions & 0 deletions tools/Beef.CodeGen.Core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Represents the **NuGet** versions.

## v4.1.4
- *Fixed*: Issue [74](https://github.com/Avanade/Beef/issues/74) fixed. There was an additional issue where the value was set to `false` it in turn resulted in `Authorize` versus `AllowAnonymous` which has been corrected.

## v4.1.3
- *Fixed*: Issue [74](https://github.com/Avanade/Beef/issues/74) fixed. `WebApiAuthorize` attribute was honouring previous override sideeffect. Changed attribute configuration from a `bool` to a `string`. Code-gen will output the supplied value as-is. XML boolean values are automatically converted. _Note:_ the XML Schema and corresponding documentation have not been updated; this will occur during a future release.

Expand Down
5 changes: 4 additions & 1 deletion tools/Beef.CodeGen.Core/CodeGenConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private CodeGenConsole()

_expectNoChange = App.Option("--expectNoChanges", "Expect no changes in the output and error where changes are detected (e.g. within build pipeline).", CommandOptionType.NoValue);

_logger = Logger.Default ?? new ColoredConsoleLogger(nameof(CodeGenConsole));
_logger = Logger.Default == null ? Logger.Default = new ColoredConsoleLogger(nameof(CodeGenConsole)) : Logger.Default;

App.OnExecuteAsync(async (_) =>
{
Expand Down Expand Up @@ -126,6 +126,9 @@ public async Task<int> RunAsync(string[] args)
catch (CommandParsingException cpex)
{
_logger.LogError(cpex.Message);
if (cpex.InnerException != null)
_logger.LogError(cpex.InnerException.Message);

return -1;
}
}
Expand Down
6 changes: 3 additions & 3 deletions tools/Beef.CodeGen.Core/Config/XmlJsonRename.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ public static class XmlJsonRename

private static readonly List<(ConfigurationEntity Entity, string XmlName, Func<string?, string?> Converter)> _xmlToJsonConvert = new List<(ConfigurationEntity, string, Func<string?, string?>)>(new (ConfigurationEntity, string, Func<string?, string?>)[]
{
(ConfigurationEntity.CodeGen, "WebApiAuthorize", (xml) => string.IsNullOrEmpty(xml) ? null : (xml == "true" ? "Authorize" : (xml == "false" ? "Authorize" : xml))),
(ConfigurationEntity.CodeGen, "WebApiAuthorize", (xml) => string.IsNullOrEmpty(xml) ? null : (xml == "true" ? "Authorize" : (xml == "false" ? "AllowAnonymous" : xml))),
(ConfigurationEntity.Entity, "ExcludeData", (xml) => string.IsNullOrEmpty(xml) ? null : (xml == "true" ? "Yes" : "Mapper")),
(ConfigurationEntity.Entity, "WebApiAuthorize", (xml) => string.IsNullOrEmpty(xml) ? null : (xml == "true" ? "Authorize" : (xml == "false" ? "Authorize" : xml))),
(ConfigurationEntity.Operation, "WebApiAuthorize", (xml) => string.IsNullOrEmpty(xml) ? null : (xml == "true" ? "Authorize" : (xml == "false" ? "Authorize" : xml)))
(ConfigurationEntity.Entity, "WebApiAuthorize", (xml) => string.IsNullOrEmpty(xml) ? null : (xml == "true" ? "Authorize" : (xml == "false" ? "AllowAnonymous" : xml))),
(ConfigurationEntity.Operation, "WebApiAuthorize", (xml) => string.IsNullOrEmpty(xml) ? null : (xml == "true" ? "Authorize" : (xml == "false" ? "AllowAnonymous" : xml)))
});

/// <summary>
Expand Down

0 comments on commit d1cca5e

Please sign in to comment.