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

Commit e9544bb

Browse files
author
N. Taylor Mullen
committed
Addressed code review comments.
1 parent 9bc627f commit e9544bb

File tree

7 files changed

+32
-34
lines changed

7 files changed

+32
-34
lines changed

src/Microsoft.AspNet.Mvc.Razor.Host/GeneratedTagHelperAttributeContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ namespace Microsoft.AspNet.Mvc.Razor
1111
public class GeneratedTagHelperAttributeContext
1212
{
1313
/// <summary>
14-
/// String representation of the model expression type.
14+
/// Name of the model expression type.
1515
/// </summary>
1616
public string ModelExpressionTypeName { get; set; }
1717

1818
/// <summary>
19-
/// String representation of a method to create model expression types.
19+
/// Name the method to create <c>ModelExpression</c>s.
2020
/// </summary>
2121
public string CreateModelExpressionMethodName { get; set; }
2222
}

src/Microsoft.AspNet.Mvc.Razor.Host/MvcCSharpCodeBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ public class MvcCSharpCodeBuilder : CSharpCodeBuilder
1616
private readonly string _activateAttribute;
1717

1818
public MvcCSharpCodeBuilder([NotNull] CodeBuilderContext context,
19-
[NotNull] GeneratedTagHelperAttributeContext tagHelperAttributeContext,
2019
[NotNull] string defaultModel,
21-
[NotNull] string activateAttribute)
20+
[NotNull] string activateAttribute,
21+
[NotNull] GeneratedTagHelperAttributeContext tagHelperAttributeContext)
2222
: base(context)
2323
{
2424
_tagHelperAttributeContext = tagHelperAttributeContext;

src/Microsoft.AspNet.Mvc.Razor.Host/MvcRazorHost.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,13 @@ public override CodeBuilder DecorateCodeBuilder([NotNull] CodeBuilder incomingBu
191191
UpdateCodeBuilder(context);
192192

193193
return new MvcCSharpCodeBuilder(context,
194+
DefaultModel,
195+
ActivateAttribute,
194196
new GeneratedTagHelperAttributeContext
195197
{
196198
ModelExpressionTypeName = ModelExpressionType,
197199
CreateModelExpressionMethodName = CreateModelExpressionMethod
198-
},
199-
DefaultModel,
200-
ActivateAttribute);
200+
});
201201
}
202202

203203
private void UpdateCodeBuilder(CodeGeneratorContext context)

src/Microsoft.AspNet.Mvc.Razor.Host/MvcTagHelperAttributeValueCodeRenderer.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public MvcTagHelperAttributeValueCodeRenderer([NotNull] GeneratedTagHelperAttrib
3131
/// </remarks>
3232
public override void RenderAttributeValue([NotNull] TagHelperAttributeDescriptor attributeDescriptor,
3333
[NotNull] CSharpCodeWriter writer,
34-
[NotNull] CodeBuilderContext context,
34+
[NotNull] CodeBuilderContext codeBuilderContext,
3535
[NotNull] Action<CSharpCodeWriter> renderAttributeValue)
3636
{
3737
var propertyType = attributeDescriptor.PropertyInfo.PropertyType;
@@ -44,14 +44,13 @@ public override void RenderAttributeValue([NotNull] TagHelperAttributeDescriptor
4444
.Write(ModelLambdaVariableName)
4545
.Write(".");
4646

47-
// TODO: Enable intellisense for ModelExpressions in https://github.com/aspnet/Mvc/issues/1252.
4847
renderAttributeValue(writer);
4948

5049
writer.WriteEndMethodInvocation(endLine: false);
5150
}
5251
else
5352
{
54-
base.RenderAttributeValue(attributeDescriptor, writer, context, renderAttributeValue);
53+
base.RenderAttributeValue(attributeDescriptor, writer, codeBuilderContext, renderAttributeValue);
5554
}
5655
}
5756
}

test/Microsoft.AspNet.Mvc.Razor.Host.Test/CommonTagHelpers.cs

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using Microsoft.AspNet.Mvc.Rendering;
5+
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
6+
7+
namespace Microsoft.AspNet.Mvc.Razor
8+
{
9+
public class InputTestTagHelper : TagHelper
10+
{
11+
public ModelExpression For { get; set; }
12+
}
13+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
namespace Microsoft.AspNet.Mvc.Rendering
5+
{
6+
// This is here to mimic the real ModelExpression type defined in Microsoft.AspNet.Mvc.Core.
7+
public class ModelExpression
8+
{
9+
}
10+
}

0 commit comments

Comments
 (0)