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

Sholtee / injector / 2251

27 Dec 2023 10:00AM UTC coverage: 90.723% (-2.0%) from 92.704%
2251

push

appveyor

Sholtee
Merge branch 'drop_opencover'

2171 of 2393 relevant lines covered (90.72%)

0.91 hits per line

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

85.71
/SRC/Interfaces/Public/Exceptions/ServiceNotFoundException.cs
1
/********************************************************************************
2
* ServiceNotFoundException.cs                                                   *
3
*                                                                               *
4
* Author: Denes Solti                                                           *
5
********************************************************************************/
6
using System;
7

8
namespace Solti.Utils.DI.Interfaces
9
{
10
    /// <summary>
11
    /// The exception that is thrown when a service could not be found.
12
    /// </summary>
13
    /// <remarks>If the requested service is optional, consider using the <see cref="IInjector.TryGet(Type, object?)"/> method in order to avoid this error.</remarks>
14
    public sealed class ServiceNotFoundException : Exception
15
    {
16
        /// <summary>
17
        /// Creates a new <see cref="ServiceNotFoundException"/> instance.
18
        /// </summary>
19
        public ServiceNotFoundException(string message, AbstractServiceEntry? requestor, IServiceId requested) : base(message)
1✔
20
        {
1✔
21
            Requestor = requestor;
1✔
22
            Requested = requested ?? throw new ArgumentNullException(nameof(requested));
×
23
        }
1✔
24

25
        /// <summary>
26
        /// The dependant service which requested the missing service.
27
        /// </summary>
28
        /// <remarks>This property may be null if the request was initiated from user code: <code>scope.Get&lt;IMissingService&gt;()</code></remarks>
29
        public AbstractServiceEntry? Requestor { get; }
1✔
30

31
        /// <summary>
32
        /// The requested service.
33
        /// </summary>
34
        public IServiceId Requested { get; }
1✔
35
    }
36
}
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

© 2025 Coveralls, Inc