Skip to content

Commit

Permalink
fix: filter microsoft assemblies from assembly scanning
Browse files Browse the repository at this point in the history
  • Loading branch information
cugoszi committed Jan 31, 2024
1 parent 30a3e39 commit ef33a3f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ public static IServiceCollection AddDependencyCall(
s => s
.FromAssemblies(
applicationAssemblies ??
AppDomain.CurrentDomain.GetAssemblies()) // TODO: remove scrutor and register by own util
AppDomain.CurrentDomain.GetAssemblies()
// Filter microsoft assemblies due to reflection problems in Microsoft.Data.SqlClient
.Where(a => a.FullName?.StartsWith("Microsoft", StringComparison.Ordinal) != true))
.AddClasses(c => c.AssignableTo(typeof(IDependencyCall<,>)))
.AsImplementedInterfaces()
.AsImplementedInterfaces()// TODO: remove scrutor and register by own util
.WithTransientLifetime());
return services
.AddSingleton<IDependencyCallDispatcher, DefaultDependencyCallDispatcher>();
Expand Down

0 comments on commit ef33a3f

Please sign in to comment.