Skip to content

Commit

Permalink
feat:optimization topic default value
Browse files Browse the repository at this point in the history
  • Loading branch information
duiapro committed Apr 26, 2024
1 parent bf24d3f commit 3fb1fea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ public abstract record IntegrationDomainEvent(Guid EventId, DateTime EvenCreateT
protected IntegrationDomainEvent() : this(Guid.NewGuid(), DateTime.UtcNow)
{
// ReSharper disable once VirtualMemberCallInConstructor
if (string.IsNullOrWhiteSpace(Topic)) Topic = GetType().Name;
if (string.IsNullOrWhiteSpace(Topic)) Topic = GetType().FullName ?? GetType().Name;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents;

public abstract record IntegrationEvent : IIntegrationEvent
{
[JsonInclude]public Guid EventId { private get; set; }
[JsonInclude] public Guid EventId { private get; set; }

[JsonInclude]
public DateTime EvenCreateTime { private get; set; }

[NotMapped] [JsonIgnore] public IUnitOfWork? UnitOfWork { get; set; }
[NotMapped][JsonIgnore] public IUnitOfWork? UnitOfWork { get; set; }

public virtual string Topic { get; set; }

Expand All @@ -20,7 +20,7 @@ protected IntegrationEvent() : this(Guid.NewGuid(), DateTime.UtcNow)

protected IntegrationEvent(Guid eventId, DateTime creationTime)
{
if (string.IsNullOrWhiteSpace(Topic)) Topic = GetType().Name;
if (string.IsNullOrWhiteSpace(Topic)) Topic = GetType().FullName ?? GetType().Name;

EventId = eventId;
EvenCreateTime = creationTime;
Expand Down

0 comments on commit 3fb1fea

Please sign in to comment.