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

f2calv / CasCap.Common / 12816423191

16 Jan 2025 07:45PM UTC coverage: 0.362%. Remained the same
12816423191

push

github

web-flow
F2calv/2025 01 updates3 - bug fix (#212)

* wide range of code improvements

* update

* cleanup

* bug fix

* lint fix

0 of 310 branches covered (0.0%)

Branch coverage included in aggregate %.

0 of 13 new or added lines in 4 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
{
NEW
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
        {
18
            _logger.LogError(ex, $"{nameof(JsonSerializer.Serialize)} failed");
×
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
        {
34
            _logger.LogError(ex, $"{nameof(JsonSerializer.Deserialize)} failed");
×
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