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

net-daemon / netdaemon / 17584992937

09 Sep 2025 01:56PM UTC coverage: 83.915% (-0.06%) from 83.971%
17584992937

push

github

web-flow
Support for Delegate style minimal Apps (#1326)

* Also support IHostApplicationBuilder instead of only IhostBuilder

* fix merge error

* Initial version of Func style Apps

* Working

* Complete tests

* Reverse order of Id and Handler

* fix tests

* fix warnings

858 of 1147 branches covered (74.8%)

Branch coverage included in aggregate %.

30 of 31 new or added lines in 9 files covered. (96.77%)

3352 of 3870 relevant lines covered (86.61%)

1379.21 hits per line

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

78.95
/src/AppModel/NetDaemon.AppModel/Internal/AppFactories/ClassAppFactory.cs
1
using System.Reflection;
2

3
namespace NetDaemon.AppModel.Internal.AppFactories;
4

5
internal class ClassAppFactory(Type type, string? id = default, bool? focus = default) : IAppFactory
149✔
6
{
7
    public object Create(IServiceProvider provider)
8
    {
9
        return ActivatorUtilities.CreateInstance(provider, type);
109✔
10
    }
11

12
    public string Id { get; } = id ?? GetAppId(type);
559✔
13

14
    public bool HasFocus { get; } = focus ?? type.GetCustomAttribute<FocusAttribute>() is not null;
264!
15

16
    private static string GetAppId(Type type)
17
    {
18
        var attribute = type.GetCustomAttribute<NetDaemonAppAttribute>();
149✔
19
        var id = attribute?.Id ?? type.FullName;
149!
20

21
        if (string.IsNullOrEmpty(id))
149!
22
        {
NEW
23
            throw new InvalidOperationException($"Could not get app id from {type}");
×
24
        }
25

26
        return id;
149✔
27
    }
28
}
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