Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Added TagHelper support for enums. #585

Merged
merged 1 commit into from
Oct 29, 2015
Merged

Conversation

NTaylorMullen
Copy link
Member

  • If a TagHelper attribute is an enum then you no longer need to provide the enum name. To override this functionality you can add the @ symbol.
  • Added code generation tests.
  • Added TagHelperDescriptorFactoryTests that double for Precompilation tests.
    Tag Helpers: Add enum attribute support. #196

@NTaylorMullen
Copy link
Member Author

/cc @dougbu @pranavkm @ajaybhargavb

@@ -56,6 +56,12 @@ public class TagHelperAttributeValueCodeRenderer
throw new ArgumentNullException(nameof(renderAttributeValue));
}

if (attributeDescriptor.IsEnum && !complexValue)
{
writer.Write(attributeDescriptor.TypeName)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be the FullName? Same class of issue as #580

Copy link
Member Author

Choose a reason for hiding this comment

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

TypeName is the equivalent to FullName

@NTaylorMullen
Copy link
Member Author

Bump

@pranavkm
Copy link
Contributor

:shipit:

@@ -56,6 +56,12 @@ public class TagHelperAttributeValueCodeRenderer
throw new ArgumentNullException(nameof(renderAttributeValue));
}

if (attributeDescriptor.IsEnum && !complexValue)
Copy link
Member

Choose a reason for hiding this comment

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

This class is used three times in CSharpTagHelperCodeRenderer but the new code is relevant only for CSharpTagHelperCodeRenderer.RenderRawAttributeValue(). Suggest moving this addition there.

@dougbu
Copy link
Member

dougbu commented Oct 28, 2015

⌚ for one location question and MVC reaction PR.

@NTaylorMullen
Copy link
Member Author

🆙 📅

MVC Pr: aspnet/Mvc#3435

// So quoting or buffering are not helpful.
RenderRawAttributeValue(attributeValueChunk, attributeDescriptor, isPlainTextValue);
RenderCodeAttributeValue(attributeValueChunk, attributeDescriptor, isPlainTextValue);
Copy link
Member

Choose a reason for hiding this comment

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

👏

@dougbu
Copy link
Member

dougbu commented Oct 28, 2015

:shipit: once aspnet/Mvc#3435 is ready.

- If a `TagHelper` attribute is an `enum` then you no longer need to provide the `enum` name. To override this functionality you can add the `@` symbol.
- Added code generation tests.
- Added `TagHelperDescriptorFactoryTest`s that double for Precompilation tests.

#196
@NTaylorMullen NTaylorMullen merged commit 22ecf85 into dev Oct 29, 2015
@NTaylorMullen NTaylorMullen deleted the nimullen/enumsupport.196 branch October 29, 2015 18:11
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.

None yet

4 participants