diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/MvcCSharpCodeBuilder.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/MvcCSharpCodeBuilder.cs index 9114f0383c..9026fc2741 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/MvcCSharpCodeBuilder.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/MvcCSharpCodeBuilder.cs @@ -23,7 +23,7 @@ namespace Microsoft.AspNet.Mvc.Razor // NOTE: If there's more than 1 model chunk there will be a Razor error BUT we want intellisense to // show up on the current model chunk that the user is typing. var modelChunk = Context.CodeTreeBuilder.CodeTree.Chunks.OfType() - .LastOrDefault(); + .LastOrDefault(); // If there were any model chunks then we need to modify the class declaration signature. if (modelChunk != null) @@ -55,7 +55,7 @@ namespace Microsoft.AspNet.Mvc.Razor writer.WriteLineHiddenDirective(); var arguments = injectVisitor.InjectChunks - .Select(chunk => new KeyValuePair(chunk.TypeName, + .Select(chunk => new KeyValuePair(chunk.TypeName, chunk.MemberName)); using (writer.BuildConstructor("public", Context.ClassName, arguments)) { diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/ModelChunkVisitorTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/ModelChunkVisitorTest.cs index 76867afa6c..e1fe844840 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/ModelChunkVisitorTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/ModelChunkVisitorTest.cs @@ -112,8 +112,8 @@ Environment.NewLine + }; host.NamespaceImports.Clear(); var engine = new RazorTemplateEngine(host); - var source = ReadResource("Model.cshtml"); - var expectedCode = ReadResource("Model.cs"); + var source = ReadResource("TestFiles/Input/Model.cshtml"); + var expectedCode = ReadResource("TestFiles/Output/Model.cs"); var expectedLineMappings = new List { BuildLineMapping(7, 0, 7, 126, 6, 7, 30),