Skip to content

Commit

Permalink
#101 Accessibility - serialization library change
Browse files Browse the repository at this point in the history
  • Loading branch information
kgniazdowski committed Aug 2, 2021
1 parent 1efe85c commit f0b8075
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.EntityFrameworkCore;
using Core.DomainEvents;
using Core.Processing.Outbox;
using System.Text.Json;
using Newtonsoft.Json;

namespace Core.Processing
{
Expand Down Expand Up @@ -63,7 +63,7 @@ private async Task PersistNotifications(List<IDomainEventNotification<IDomainEve
var entity = new OutboxNotification(
notification.GetType().FullName,
notification.DomainEvent.OccuredOn,
JsonSerializer.Serialize(notification)
JsonConvert.SerializeObject(notification)
);
await ctx.AddAsync(entity);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System;
using System.Linq;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Core.Database;
using Core.DomainEvents;
using Dapper;
using MediatR;
using Newtonsoft.Json;

namespace Core.Processing.Outbox
{
Expand Down Expand Up @@ -53,7 +53,7 @@ public async Task<Unit> Handle(ProcessOutboxCommand request, CancellationToken c
foreach (var entity in entities)
{
var type = assemblyProvider.Application.GetType(entity.Type);
var notification = JsonSerializer.Deserialize(entity.Data, type) as IDomainEventNotification;
var notification = JsonConvert.DeserializeObject(entity.Data, type) as IDomainEventNotification;

await mediator.Publish(notification, cancellationToken);

Expand Down
1 change: 1 addition & 0 deletions accessibility-service/src/Core/Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<ItemGroup>
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Scrutor" Version="3.3.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Text.Json.Serialization;
using Core.Domain;
using Newtonsoft.Json;

namespace Core.DomainEvents
{
Expand Down

0 comments on commit f0b8075

Please sign in to comment.