Browse Source

File added.

pull/249/head
Sebastian Stehle 8 years ago
parent
commit
56ef76d627
  1. 32
      src/Squidex.Infrastructure/Commands/DomainObjectGrainFormatter.cs
  2. 2
      tests/Squidex.Infrastructure.Tests/EventSourcing/RetrySubscriptionTests.cs

32
src/Squidex.Infrastructure/Commands/DomainObjectGrainFormatter.cs

@ -0,0 +1,32 @@
// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschraenkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System;
using Orleans;
namespace Squidex.Infrastructure.Commands
{
public static class DomainObjectGrainFormatter
{
public static string Format(IGrainCallContext context)
{
if (context.Method == null)
{
return "Unknown";
}
if (string.Equals(context.Method.Name, nameof(IDomainObjectGrain.ExecuteAsync), StringComparison.CurrentCultureIgnoreCase) &&
context.Arguments?.Length == 1 &&
context.Arguments[0] != null)
{
return context.Arguments[0].ToString();
}
return context.Method.Name;
}
}
}

2
tests/Squidex.Infrastructure.Tests/EventSourcing/RetrySubscriptionTests.cs

@ -44,7 +44,7 @@ namespace Squidex.Infrastructure.EventSourcing
{
await OnErrorAsync(eventSubscription, new InvalidOperationException());
await Task.Delay(200);
await Task.Delay(400);
await sut.StopAsync();

Loading…
Cancel
Save