Skip to content
This repository has been archived by the owner on Feb 25, 2021. It is now read-only.

Fixup project templates to handle project names with dashes #692

Merged
merged 4 commits into from
May 1, 2018

Conversation

danroth27
Copy link
Member

This template update is a partial fix for when the project name has a dash in it.

It's only a partial fix because it doesn't address sanitizing the namespace for the generated component classes. @rynowak Is this something you could help me out with?

@danroth27 danroth27 force-pushed the danroth27/hyphen-in-name branch 2 times, most recently from d457a80 to 9eb6171 Compare April 30, 2018 13:20
@danroth27 danroth27 changed the title [WIP] Fixup project templates to handle project names with dashes Fixup project templates to handle project names with dashes Apr 30, 2018
var segments = baseNamespace.Split(NamespaceSeparators, StringSplitOptions.RemoveEmptyEntries);
builder.Append(CSharpIdentifier.SanitizeClassName(segments[0]));
if (segments.Length > 1)
{
Copy link
Member

Choose a reason for hiding this comment

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

If is not necessary. The loop will noop if the length == 0.

@danroth27
Copy link
Member Author

🆙📅

var type = Assert.Single(result.Assembly.GetTypes());
Assert.Equal(expectedNamespace, type.Namespace);
Assert.Equal(expectedClassName, type.Name);
}
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

Copy link
Member

@rynowak rynowak left a comment

Choose a reason for hiding this comment

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

This looks great!

@danroth27 danroth27 merged commit a178cd4 into dev May 1, 2018
@danroth27 danroth27 deleted the danroth27/hyphen-in-name branch July 24, 2018 05:11
SteveSandersonMS pushed a commit to SteveSandersonMS/BlazorMigration that referenced this pull request Nov 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants