Merge pull request #3956 from sbwalker/dev
add IClientService support to .NET MAUI
This commit is contained in:
commit
aa3325ef35
|
@ -255,6 +255,16 @@ public static class MauiProgram
|
||||||
services.AddScoped(serviceType ?? implementationType, implementationType);
|
services.AddScoped(serviceType ?? implementationType, implementationType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
implementationTypes = assembly.GetInterfaces<IClientService>();
|
||||||
|
foreach (var implementationType in implementationTypes)
|
||||||
|
{
|
||||||
|
if (implementationType.AssemblyQualifiedName != null)
|
||||||
|
{
|
||||||
|
var serviceType = Type.GetType(implementationType.AssemblyQualifiedName.Replace(implementationType.Name, $"I{implementationType.Name}"));
|
||||||
|
services.AddScoped(serviceType ?? implementationType, implementationType);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user