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

JaCraig / SerialBox / 11905976443

19 Nov 2024 03:59AM UTC coverage: 69.118%. First build
11905976443

push

github

JaCraig
feat: Updating to .Net 8/9 and workflow updates

- Migrating to .Net 8/9 due to issues with new MS packages.
- Updating workflows.
- Updated code to take advantage of .Net 8+ constructs.

BREAKING CHANGE: Removing .Net 6/7 support as .Net 9 dependencies say they work with it in the package but then throw warnings. I don't know why this approach was taken but it breaks a bunch of automation.

47 of 88 branches covered (53.41%)

Branch coverage included in aggregate %.

94 of 115 new or added lines in 8 files covered. (81.74%)

94 of 116 relevant lines covered (81.03%)

5.78 hits per line

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

37.5
/SerialBox/Registration/Register.cs
1
/*
2
Copyright 2016 James Craig
3

4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7

8
    http://www.apache.org/licenses/LICENSE-2.0
9

10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
*/
16

17
using Canister.Interfaces;
18
using Microsoft.Extensions.DependencyInjection;
19
using SerialBox.Interfaces;
20
using System.Reflection;
21

22
namespace SerialBox.Registration
23
{
24
    /// <summary>
25
    /// Registration extension methods
26
    /// </summary>
27
    public static class Registration
28
    {
29
        /// <summary>
30
        /// Registers the library with the bootstrapper.
31
        /// </summary>
32
        /// <param name="bootstrapper">The bootstrapper.</param>
33
        /// <returns>The bootstrapper</returns>
NEW
34
        public static ICanisterConfiguration? RegisterSerialBox(this ICanisterConfiguration? bootstrapper) => bootstrapper?.AddAssembly(typeof(Registration).GetTypeInfo().Assembly);
×
35

36
        /// <summary>
37
        /// Registers the SerialBox services with the specified IServiceCollection.
38
        /// </summary>
39
        /// <param name="services">The IServiceCollection to add the services to.</param>
40
        /// <returns>The IServiceCollection with the registered services.</returns>
41
        public static IServiceCollection? RegisterSerialBox(this IServiceCollection? services) => services?.AddAllTransient<ISerializer>()?.AddSingleton<SerialBox>();
1!
42
    }
43
}
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