Skip to content

Commit

Permalink
Added support for setting objects over publish / subscribe of entity …
Browse files Browse the repository at this point in the history
…events
  • Loading branch information
vivet committed Oct 5, 2024
1 parent ef5c04a commit cebc6b3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
16 changes: 15 additions & 1 deletion Nano.Eventing/Handlers/EntityEventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,20 @@ private void SetEntityEventProperties(EntityEvent @event, IReflect type, object
dataProperty
.SetValue(entity, guidValue);
}
else if (dataProperty.PropertyType == typeof(TimeOnly) || dataProperty.PropertyType == typeof(TimeOnly?))
{
var guidValue = TimeOnly.Parse(value);

dataProperty
.SetValue(entity, guidValue);
}
else if (dataProperty.PropertyType == typeof(DateOnly) || dataProperty.PropertyType == typeof(DateOnly?))
{
var guidValue = DateOnly.Parse(value);

dataProperty
.SetValue(entity, guidValue);
}
else if (dataProperty.PropertyType == typeof(DateTime) || dataProperty.PropertyType == typeof(DateTime?))
{
var dateTimeValue = DateTime.Parse(value);
Expand Down Expand Up @@ -247,7 +261,7 @@ private void SetEntityEventProperties(EntityEvent @event, IReflect type, object
else
{
dataProperty
.SetValue(entity, value);
.SetValue(entity, pair.Value);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions NanoCore.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>NanoCore</id>
<version>8.1.28</version>
<version>8.1.29</version>
<title>Nano Core</title>
<summary>Rapidly built and deploy rich .NET 8.0 applications. Configuration, Security, Logging, Data, Hosting, Docs, Localization, Versioning, Api, Error-Handling, and much more.</summary>
<description>The project is inspired by years of tedious repetitions, continuously re-writing similar code-snippets and libraries, to handle common functionality, not related to the business domain, such as logging, data persistence, message queuing, documentation, validation and similar.</description>
Expand All @@ -16,7 +16,7 @@
<projectUrl>https://github.com/Nano-Core</projectUrl>
<repository type="git" url="https://github.com/Nano-Core/Nano.Library.git" />
<releaseNotes>
- Fixed audit logging when having shares owned types, that can not be found exclusively with context.GetEntry(entity).
- Added support for setting objects over publish / subscribe of entity events.
</releaseNotes>
<dependencies>
<group targetFramework="net8.0">
Expand Down

0 comments on commit cebc6b3

Please sign in to comment.