nclient / NClient

:dizzy: NClient is an automatic type-safe .Net HTTP client that allows you to call web service API methods using annotated interfaces or controllers without boilerplate code.
Apache License 2.0
43 stars 11 forks source link

Selecting the scope for the client in DI #460

Closed Kingmidas74 closed 1 year ago

Kingmidas74 commented 1 year ago

Add options to change DI lifetime for NClient. 1) general Add.. methos now has optional parameter ServiceLifeTime (singleton by default) 2) Many new extensions like Add...Singleton(), Add...Transient(), etc.

Kingmidas74 commented 1 year ago

@smolchanovsky

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 6 Code Smells

37.0% 37.0% Coverage
0.0% 0.0% Duplication

smolchanovsky commented 1 year ago

Great job! But the test coverage is confusing: 37.0% Coverage

Kingmidas74 commented 1 year ago

Great job! But the test coverage is confusing: 37.0% Coverage

So... which type of test do you want? There are only method overloads without any logic. I'm open to any offers

smolchanovsky commented 1 year ago

Great job! But the test coverage is confusing: 37.0% Coverage

So... which type of test do you want? There are only method overloads without any logic. I'm open to any offers

I agree with you, logic is pretty simple, but we should have tests to protect us from typos. For example, method must create singleton instance, but creates scoped

Kingmidas74 commented 1 year ago

Great job! But the test coverage is confusing: 37.0% Coverage

So... which type of test do you want? There are only method overloads without any logic. I'm open to any offers

I agree with you, logic is pretty simple, but we should have tests to protect us from typos. For example, method must create singleton instance, but creates scoped

so.. is it enough now?

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

62.8% 62.8% Coverage
0.0% 0.0% Duplication