Skip to content

Conversation

@deepsource-autofix
Copy link
Contributor

This PR refactors multiple lambda expressions that only contain a single statement, converting them from block-bodied forms with braces and explicit return keywords to concise expression-bodied lambdas. Across service registrations, domain logic, and test assertions, redundant braces and return statements have been removed to improve readability and reduce verbosity.

  • Consider simplifying lambda when its body has a single statement: Many lambdas in service registration (e.g., AddSingleton<Func<String, String>>, AddSingleton<Func<String, Int32, ISubscriptionRepository>>) and in tests (e.g., Should.Throw, Should.NotThrow, Retry.For) were written with braces wrapping a single return or await call. Each of these has been converted to an expression-bodied lambda, eliminating unnecessary braces and return/async block syntax.

This Autofix was generated by AI. Please review the change before merging.

This PR refactors multiple lambda expressions that only contain a single statement, converting them from block-bodied forms with braces and explicit return keywords to concise expression-bodied lambdas. Across service registrations, domain logic, and test assertions, redundant braces and return statements have been removed to improve readability and reduce verbosity.

- Consider simplifying lambda when its body has a single statement: Many lambdas in service registration (e.g., `AddSingleton<Func<String, String>>`, `AddSingleton<Func<String, Int32, ISubscriptionRepository>>`) and in tests (e.g., `Should.Throw`, `Should.NotThrow`, `Retry.For`) were written with braces wrapping a single return or await call. Each of these has been converted to an expression-bodied lambda, eliminating unnecessary braces and `return`/`async` block syntax.

> This Autofix was generated by AI. Please review the change before merging.
@deepsource-io
Copy link

deepsource-io bot commented Sep 22, 2025

Here's the code health analysis summary for commits e251d66..154a4c4. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource C# LogoC#❌ Failure
❗ 1 occurence introduced
🎯 17 occurences resolved
View Check ↗
DeepSource Docker LogoDocker✅ SuccessView Check ↗
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗
DeepSource SQL LogoSQL✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@StuartFerguson StuartFerguson merged commit 7ecfeb4 into master Sep 22, 2025
12 of 14 checks passed
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.

2 participants