This repository was archived by the owner on Dec 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Tag Helpers: Add ModelExpression code generation #1300
Closed
NTaylorMullen
wants to merge
6
commits into
TagHelpersFeature
from
TagHelpers_ModelExpressionCodeGen
Closed
Tag Helpers: Add ModelExpression code generation #1300
NTaylorMullen
wants to merge
6
commits into
TagHelpersFeature
from
TagHelpers_ModelExpressionCodeGen
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#line hidden | ||
|
||
#pragma warning disable 1998 | ||
public override async Task ExecuteAsync() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being empty is expected behavior for now. TagHelper
s don't support DesignTime intellisense pieces so we don't generate anything for them during DesignTime.
That will be done in this issue: #1252.
8b68658
to
ce49b77
Compare
b3ae381
to
0f6c981
Compare
d948242
to
b68fae9
Compare
public string ModelExpressionTypeName { get; set; } | ||
|
||
/// <summary> | ||
/// String representation of a method to create model expression types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "String representation" -> "Name" here and above (!!)
- just "model expressions" or
<c>ModelExpression</c>s
since there's just one such type and this method creates instances in any case (not types) - nit: "the method"
please rebase TagHelpers_ModelExpressionCodeGen branch and force-push it here. no longer possible to see your changes |
0f6c981
to
e9544bb
Compare
Addressed code review comments and rebased. |
|
||
namespace Microsoft.AspNet.Mvc.Rendering | ||
{ | ||
// This is here to mimic the real ModelExpression type defined in Microsoft.AspNet.Mvc.Core. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
|
- Sealed the ModelExpression. - We use the stringified version of the ModelExpression type name to detect ModelExpression properties on TagHelpers. This is so the MvcRazorHost can work in tooling and in runtime. - Created a GeneratedTagHelperAttributeContext to represent the specific stringified versions of the ModelExpression assets. - Created an MvcTagHelperAttributeValueCodeRenderer to modify rendering of ModelExpression properties. #1241
- Exposed internals from Mvc.Razor.Host to Mvc.Razor.Test so it can use the MvcRazorHost override that takes the IFileSystem. - Added end-to-end code generation tests for TagHelpers with ModelExpression properties. #1241
e9544bb
to
75a77e2
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added tests to validate attribute value rendering
Tag Helpers: add code generation for
ModelExpression
instances #1241/cc @dougbu