• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

f2calv / CasCap.Common / 12978407788

26 Jan 2025 09:14PM UTC coverage: 0.362%. Remained the same
12978407788

push

github

web-flow
F2calv/2025 01 extensive caching rework (#213)

* _logger.Error className added

* _logger.Critical className added

* accessors added

* _logger.LogDebug className added

* update devcontainer image

* documentation

* nullable fixes

* additions

* nuget updates

* tidied docker-compose w/p3x

* +semver: feature distCache expiration overhaul incl. slidingExpiration

* added AbsoluteExpirationTest_Async()

* tidy

* update docker-compose for redis

* added RemoteCacheInvalidationBgService

* fixup

* subscribe to expiration events

* lint fixes

0 of 310 branches covered (0.0%)

Branch coverage included in aggregate %.

0 of 4 new or added lines in 3 files covered. (0.0%)

3 of 519 relevant lines covered (0.58%)

0.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/CasCap.Common.Serialization.Json/Extensions/JsonSerializationHelpers.cs
1
namespace CasCap.Common.Extensions;
2

3
public static class JsonSerializationHelpers
4
{
5
    private static readonly ILogger _logger = ApplicationLogging.CreateLogger(nameof(JsonSerializationHelpers));
×
6

7
    public static string ToJson(this object obj) => obj.ToJson(options: null);
×
8

9
    public static string ToJson(this object obj, JsonSerializerOptions? options)
10
    {
11
        obj = obj ?? throw new ArgumentNullException(paramName: nameof(obj));
×
12
        try
13
        {
14
            return JsonSerializer.Serialize(obj, options);
×
15
        }
16
        catch (Exception ex)
×
17
        {
NEW
18
            _logger.LogError(ex, "{className} {methodName} failed", nameof(JsonSerializationHelpers), nameof(JsonSerializer.Serialize));
×
19
            throw;
×
20
        }
21
    }
×
22

23
    public static T? FromJson<T>(this string json) => json.FromJson<T>(options: null);
×
24

25
    public static T? FromJson<T>(this string json, JsonSerializerOptions? options)
26
    {
27
        json = json ?? throw new ArgumentNullException(paramName: nameof(json));
×
28
        try
29
        {
30
            return JsonSerializer.Deserialize<T>(json, options);
×
31
        }
32
        catch (Exception ex)
×
33
        {
NEW
34
            _logger.LogError(ex, "{className} {methodName} failed", nameof(JsonSerializationHelpers), nameof(JsonSerializer.Deserialize));
×
35
            throw;
×
36
        }
37
    }
×
38
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc