Browse Source

Warning fixed.

pull/285/head
Sebastian 9 years ago
parent
commit
0d50922ee6
  1. 3
      src/Squidex.Infrastructure/Orleans/J.cs
  2. 6
      src/Squidex.Infrastructure/Orleans/J{T}.cs

3
src/Squidex.Infrastructure/Orleans/J.cs

@ -5,12 +5,15 @@
// All rights reserved. Licensed under the MIT license. // All rights reserved. Licensed under the MIT license.
// ========================================================================== // ==========================================================================
using Newtonsoft.Json;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Squidex.Infrastructure.Orleans namespace Squidex.Infrastructure.Orleans
{ {
public static class J public static class J
{ {
internal static readonly JsonSerializer DefaultSerializer = JsonSerializer.CreateDefault();
public static J<T> AsJ<T>(this T value) public static J<T> AsJ<T>(this T value)
{ {
return new J<T>(value); return new J<T>(value);

6
src/Squidex.Infrastructure/Orleans/J{T}.cs

@ -18,8 +18,6 @@ namespace Squidex.Infrastructure.Orleans
{ {
public struct J<T> public struct J<T>
{ {
private static readonly JsonSerializer DefaultSerializer = JsonSerializer.CreateDefault();
public T Value { get; } public T Value { get; }
[JsonConstructor] [JsonConstructor]
@ -100,11 +98,11 @@ namespace Squidex.Infrastructure.Orleans
{ {
try try
{ {
return context?.ServiceProvider?.GetService<JsonSerializer>() ?? DefaultSerializer; return context?.ServiceProvider?.GetService<JsonSerializer>() ?? J.DefaultSerializer;
} }
catch catch
{ {
return DefaultSerializer; return J.DefaultSerializer;
} }
} }
} }

Loading…
Cancel
Save