Skip to content

Commit

Permalink
Fix issue #89
Browse files Browse the repository at this point in the history
  • Loading branch information
chullybun committed Nov 24, 2020
1 parent 5e74248 commit 6a7a13a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ public Task DeleteWithEfAsync(Guid id)
return DataSvcInvoker.Current.InvokeAsync(this, async () =>
{
await _data.DeleteWithEfAsync(id).ConfigureAwait(false);
await _evtPub.PublishAsync($"Demo.Person.{id}", "", id).ConfigureAwait(false);
await _evtPub.PublishAsync($"Demo.Person.{id}", "Delete", id).ConfigureAwait(false);
_cache.Remove<Person>(new UniqueKey(id));
if (_deleteWithEfOnAfterAsync != null) await _deleteWithEfOnAfterAsync(id).ConfigureAwait(false);
});
Expand Down
1 change: 1 addition & 0 deletions samples/Demo/Beef.Demo.Test/PersonTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,7 @@ public void G220_DeleteWithEf()
// Delete a person.
AgentTester.Test<PersonAgent>()
.ExpectStatusCode(HttpStatusCode.NoContent)
.ExpectEvent("Demo.Person.*", "Delete")
.Run(a => a.DeleteWithEfAsync(2.ToGuid()));

// Check person no longer exists.
Expand Down
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.9</Version>
<Version>4.1.10</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.10
- *Fixed:* Issue [89](https://github.com/Avanade/Beef/issues/89) fixed. Event publish code was being incorrectly generated where the subject was being overridden; was missing the corresponding inferred `Action`.

## v4.1.9
- *Fixed:* Issue [87](https://github.com/Avanade/Beef/issues/87) fixed. Event publish code was being incorrectly generated where `EventPublish="false"`.

Expand Down
2 changes: 2 additions & 0 deletions tools/Beef.CodeGen.Core/Config/Entity/OperationConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,8 @@ private void PrepareEvents()

if (parts.Length > 1)
ed.Action = parts[1];
else
ed.Action = ConvertEventAction(WebApiOperationType!);

if (Root!.EventSubjectRoot != null)
ed.Subject = Root!.EventSubjectRoot + "." + ed.Subject;
Expand Down

0 comments on commit 6a7a13a

Please sign in to comment.