Skip to content

code optimization #2032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open

Conversation

yilianhuaixiao
Copy link

Now that the following code:

var serviceProviderFactory = services.GetSingletonInstanceOrNull<IServiceProviderFactory<TContainerBuilder>>();
if (serviceProviderFactory == null)
		    {
			    throw new AbpException($"Could not find {typeof(IServiceProviderFactory<TContainerBuilder>).FullName} in {services}.");
		    }

requires 'IServiceProviderFactory' Service Type,
For intuition and efficiency, my code may be better. And strickly saying, they are not of equal value. If registered service type 'XxxServiceProviderFactory', the former code may throw AbpException($"Could not find {typeof(IServiceProviderFactory<TContainerBuilder>).FullName} in {services}."), my code won't.
It will just return 'services.BuildServiceProvider()'.

@yekalkan yekalkan added this to the 1.1 milestone Oct 30, 2019
@hikalkan hikalkan self-requested a review November 12, 2019 11:49
@hikalkan hikalkan modified the milestones: 1.1, backlog Nov 12, 2019
@hikalkan hikalkan removed their request for review November 12, 2019 12:07
@hikalkan
Copy link
Member

I am not sure if this produces the same result (I didn't spend time much :). I will consider this later since it has not an important enhancement.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants