Skip to content

Commit

Permalink
Use built-in, optimized UnityContainerExtensions.IsRegistered instead…
Browse files Browse the repository at this point in the history
… of Enumerable.Any to check whether a type has been registered.

Removed redundant files.
  • Loading branch information
mykolav committed May 30, 2018
1 parent 6c98342 commit 52605bf
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public override void PreBuildUp(IBuilderContext context)
{
var type = context.OriginalBuildKey.Type;

if (_container.Registrations.Any(r => r.RegisteredType == type))
if (_container.IsRegistered(type))
return;

if (!_autoFactoryProvider.TryGetOrCreate(type, out var autoFactory))
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 52605bf

Please sign in to comment.