Skip to content
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

Code cleanup #29012

Merged
merged 2 commits into from
Sep 9, 2022
Merged

Code cleanup #29012

merged 2 commits into from
Sep 9, 2022

Conversation

ajcvickers
Copy link
Contributor

Fixes #28964

@ajcvickers ajcvickers requested a review from a team September 7, 2022 15:46
Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can 🐑 🇮🇹, though we should maybe discuss if we want target-typed everywhere systematically

new DatabaseModelFactoryOptions(tables, schemas),
new ModelReverseEngineerOptions { UseDatabaseNames = useDatabaseNames, NoPluralize = noPluralize },
new ModelCodeGenerationOptions
new(tables, schemas),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW though I like target-typed construction, I'm not sure we should systematically always use it where possible - having the explicit type names makes it easier to understand what's going on in some contexts.

Maybe leave this on a case-by-case basis (i.e. no automated changing)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two settings:

image

We originally had the "not evident" setting to use new T(). But this was adding types back in to a lot of places where we had removed them.

@@ -23,7 +23,9 @@ public class ModelCodeGeneratorSelector : LanguageBasedSelector<IModelCodeGenera
/// </summary>
public ModelCodeGeneratorSelector(IEnumerable<IModelCodeGenerator> services)
: base(services.Except(services.OfType<TemplatedModelGenerator>()).ToList())
=> _templatedModelGenerators = services.OfType<TemplatedModelGenerator>().ToList();
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But why.... 😢

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably because it is an assignment. There is probably a setting for this somewhere, if we care.

mappingStrategy, entityType.DisplayName()));
}

;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

@ajcvickers ajcvickers merged commit 9262a34 into release/7.0 Sep 9, 2022
@ajcvickers ajcvickers deleted the HappyValley0907 branch September 9, 2022 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reformat code
2 participants