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

Enhance setting renaming #317

Conversation

hayletdomybest
Copy link

Hello I modify this #316
and I provider a better way to setting name by configure file, but this method can't not distinguish schema name

@hayletdomybest hayletdomybest force-pushed the feature/Enhance-setting-rename2 branch from 1ca325a to 7214646 Compare November 27, 2019 01:03
@ErikEJ
Copy link
Owner

ErikEJ commented Nov 27, 2019

Could you add some tests?

@hayletdomybest
Copy link
Author

Sure I push unit test for it

var actResult = sut.Pluralize("OldTable");

//Assert
StringAssert.Contains(expected, actResult);
Copy link
Owner

Choose a reason for hiding this comment

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

Why Contains?

new TableRenamer
{
Name = "old_table",
VariableName = "TableVariables",
Copy link
Owner

Choose a reason for hiding this comment

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

Could we find a better name?


namespace ReverseEngineer20.ReverseEngineer
{
public class InflectorPluralizer : IPluralizer
{
private readonly Dictionary<string, string> _customerCharacterPluralize;
Copy link
Owner

Choose a reason for hiding this comment

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

_customer => _custom

.Where(x => !string.IsNullOrWhiteSpace(x.VariableName))
.ToDictionary(key => key.Name.ToPascalCase(), value => value.VariableName);

_customerCharacterSingularize = customReplacers
Copy link
Owner

Choose a reason for hiding this comment

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

Will this not always block standard renaming from working?

Copy link
Author

Choose a reason for hiding this comment

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

I don't known what's your meaning
I think If you want to custom name, you only want your name is equals your naming not be transfer by other function?

@hayletdomybest hayletdomybest force-pushed the feature/Enhance-setting-rename2 branch from dc9371f to d679f76 Compare November 28, 2019 00:42
@hayletdomybest hayletdomybest force-pushed the feature/Enhance-setting-rename2 branch from d679f76 to b4dfc22 Compare November 28, 2019 00:49
@ErikEJ
Copy link
Owner

ErikEJ commented Nov 28, 2019

This looks good, will just let it sit for while until the EF Core 3.1 dust settles

@ErikEJ
Copy link
Owner

ErikEJ commented Sep 18, 2020

Closing in favor of: #496

@ErikEJ ErikEJ closed this Sep 18, 2020
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.

2 participants