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

JaCraig / DragonHoard / 11993045443

24 Nov 2024 04:12AM UTC coverage: 60.754%. First build
11993045443

push

github

JaCraig
feat: Update to .NET 8/9, centralized workflows, and refactoring

Updated target frameworks to .NET 8.0 and 9.0. Updated various package references to newer versions. Added new package reference for `coverlet.msbuild`. Removed inclusion of `..\.editorconfig` in `DragonHoard.InMemory.csproj`. Simplified method implementations using expression-bodied members. Added missing `using DragonHoard.Core;` statement. Refactored methods in `DragonHoardRegistrationExtensions.cs` and `MemoryCache.cs` for conciseness. Updated `docfx.json` to target `net8.0`. Centralized workflows for Dependabot, CodeQL, documentation, .NET publishing, and testing.

114 of 228 branches covered (50.0%)

Branch coverage included in aggregate %.

4 of 11 new or added lines in 3 files covered. (36.36%)

273 of 409 relevant lines covered (66.75%)

193406.25 hits per line

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

0.0
/DragonHoard.InMemory/ExtensionMethods/DragonHoardRegistrationExtensions.cs
1
/*
2
Copyright 2021 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 DragonHoard.Core;
19
using DragonHoard.InMemory;
20
using System;
21

22
namespace Microsoft.Extensions.DependencyInjection
23
{
24
    /// <summary>
25
    /// Reg extensions
26
    /// </summary>
27
    public static class DragonHoardInMemoryRegistrationExtensions
28
    {
29
        /// <summary>
30
        /// Adds the dragon hoard.
31
        /// </summary>
32
        /// <param name="services">The services.</param>
33
        /// <returns>The service collection</returns>
NEW
34
        public static IServiceCollection? AddInMemoryHoard(this IServiceCollection? services) => services.AddInMemoryHoard(options => options.ScanFrequency = TimeSpan.FromMinutes(1));
×
35

36
        /// <summary>
37
        /// Adds the in memory hoard.
38
        /// </summary>
39
        /// <param name="services">The services.</param>
40
        /// <param name="setupAction">The setup action.</param>
41
        /// <returns>The service collection</returns>
42
        public static IServiceCollection? AddInMemoryHoard(this IServiceCollection? services, Action<InMemoryCacheOptions> setupAction)
43
        {
NEW
44
            if (services.Exists<Cache>())
×
NEW
45
                return services?.Configure(setupAction);
×
NEW
46
            return services?.AddDragonHoard()
×
NEW
47
                    ?.Configure(setupAction);
×
48
        }
49

50
        /// <summary>
51
        /// Registers the dragon hoard.
52
        /// </summary>
53
        /// <param name="bootstrapper">The bootstrapper.</param>
54
        /// <returns>The configuration object.</returns>
NEW
55
        public static ICanisterConfiguration? RegisterInMemoryHoard(this ICanisterConfiguration? bootstrapper) => bootstrapper?.AddAssembly(typeof(DragonHoardInMemoryRegistrationExtensions).Assembly).RegisterDragonHoard();
×
56
    }
57
}
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