Added support for multiple constructors and best match greedy resolution.
Some checks failed
Nuget Pkg Build / build (push) Failing after 25s
Some checks failed
Nuget Pkg Build / build (push) Failing after 25s
This commit is contained in:
@@ -21,8 +21,23 @@ interface IOtherService {
|
||||
class GuidService : IOtherService {
|
||||
public Guid Id { get; } = Guid.NewGuid();
|
||||
}
|
||||
public interface INotRegisteredService {
|
||||
void DoSomething();
|
||||
}
|
||||
|
||||
class GuidDependantService {
|
||||
private readonly IService logService;
|
||||
private readonly IOtherService? guidService;
|
||||
|
||||
public GuidDependantService(IService logService, INotRegisteredService guidService) {
|
||||
this.logService = logService;
|
||||
}
|
||||
|
||||
public GuidDependantService(IService logService, IOtherService guidService) {
|
||||
this.logService = logService;
|
||||
this.guidService = guidService;
|
||||
}
|
||||
|
||||
class GuidDependantService(IService logService, IOtherService guidService) {
|
||||
public void LogWithId(string message) {
|
||||
logService.Log($"[GuidDependantService] {message} (ID: {guidService.Id})");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user