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

Add copy helpers for TagHelperOutput from TagBuilder. #1322

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ad20844
Updating functional tests to restore CallContextServiceLocator.Locato…
pranavkm Oct 8, 2014
e319fef
Adding CancellationTokenModelBinder.
harshgMSFT Oct 9, 2014
f663452
Add WebApiCompatShim project structure
rynowak Oct 8, 2014
d9fe305
Fix for #1275 - Adding ApiController
rynowak Oct 8, 2014
2578b81
Fix for #1277 - Add Options/Startup API for WebAPI shim
rynowak Oct 8, 2014
9b11c1d
Fix #1276 - Implement WebAPI action conventions and overloading
rynowak Oct 8, 2014
e51e0e1
Fix for issue #1279 - Add .Request property to ApiController
rynowak Oct 8, 2014
aad3ae4
Fix for issue #1281 - Add ModelBinder for HttpRequestMessage
rynowak Oct 8, 2014
22869b4
Fix issue #1280 - Add HttpResponseMessageFormatter
rynowak Oct 8, 2014
5a83383
Adding ApiController.Validate : Fixes #1286
harshgMSFT Oct 9, 2014
3968df9
Fix issue #1282 - Add Request.CreateResponse extension methods
rynowak Oct 8, 2014
9ad3d5e
Separate ApiControllers from MVC Controllers in routing
rynowak Oct 10, 2014
7fabb80
Reacting to CoreCLR version changes
pranavkm Oct 10, 2014
13ee27c
Rename IControllerAssemblyProvider to IAssemblyProvider and follow th…
Oct 11, 2014
75084ba
Move caching of compilation results to its own layer.
Oct 11, 2014
20eadb9
Remove instrumentation from public API surface
pranavkm Oct 9, 2014
18e11f5
DecorateWriter does not get called for partial views rendered via
pranavkm Oct 10, 2014
0d603a3
PR feedback and sort/clean MvcServices
Oct 12, 2014
d912f6c
Removing unused types
pranavkm Oct 13, 2014
4166c8c
Fix unit test
Oct 13, 2014
a633ef4
Modify Razor components to use RazorViewEngineOptions.FileSystem
pranavkm Oct 10, 2014
3f54492
[Fixes #885] API Explorer: Link Generation
javiercn Oct 7, 2014
3937661
[Fixes #809] Multiple [Http*] verbs should create multiple actions
javiercn Oct 8, 2014
4ec6da1
Adding RenderSectionAsync to RazorPage
pranavkm Oct 3, 2014
dd587f7
[Fixes #1331] Dispose HttpResponseMessage once its written out in Htt…
kichalla Oct 11, 2014
3f29de5
Ensure PDB writer component is available before emiting PDB
pranavkm Oct 14, 2014
0f5bbdf
updating ILogger, see aspnet/Logging#3
sonjakhan Oct 8, 2014
d9ebb37
Removing Microsoft.AspNet.Mvc dependency from ModelBinding
pranavkm Oct 14, 2014
a41b9dc
Add Html.Partial - sync versions of Html.PartialAsync
pranavkm Oct 14, 2014
5fa8a91
-Issue #913 - Model-binding is being case-sensitive when binding Url …
Oct 10, 2014
2d67f2f
Modify precompilation to always generate instrumentation
pranavkm Oct 14, 2014
1680616
[Issue #1133] RedirectToActionResult and UrlHelper should use HostStr…
javiercn Oct 1, 2014
aaaf021
Add TagHelperSample.Web
dougbu Oct 7, 2014
ecb0573
Add `IHtmlGenerator` and its default implementation
dougbu Oct 9, 2014
056baf4
Add `IHtmlGenerator` to DI and enable MVC tag helpers in TagHelperSam…
dougbu Oct 14, 2014
408e108
Add `TextAreaTagHelper` and Microsoft.AspNet.Mvc.TagHelpers project
dougbu Oct 9, 2014
1b181d3
Add tests of `TextAreaTagHelper`
dougbu Oct 14, 2014
6a61a8f
Update `HtmlHelper` to use `IHtmlGenerator`
dougbu Oct 13, 2014
199a8e2
Add extensions for TagHelperOutput to copy from TagBuilder.
Oct 13, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion Mvc.NoFun.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.22130.0
VisualStudioVersion = 14.0.22013.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{DAAE4C74-D06F-4874-A166-33305D2643CE}"
EndProject
Expand Down Expand Up @@ -42,6 +42,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
global.json = global.json
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Mvc.WebApiCompatShim", "src\Microsoft.AspNet.Mvc.WebApiCompatShim\Microsoft.AspNet.Mvc.WebApiCompatShim.kproj", "{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Mvc.WebApiCompatShimTest", "test\Microsoft.AspNet.Mvc.WebApiCompatShimTest\Microsoft.AspNet.Mvc.WebApiCompatShimTest.kproj", "{5DE8E4D9-AACD-4B5F-819F-F091383FB996}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -192,6 +196,26 @@ Global
{E69FD235-2042-43A4-9970-59CB29955B4E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{E69FD235-2042-43A4-9970-59CB29955B4E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{E69FD235-2042-43A4-9970-59CB29955B4E}.Release|x86.ActiveCfg = Release|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|x86.ActiveCfg = Debug|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|Any CPU.Build.0 = Release|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|x86.ActiveCfg = Release|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|x86.ActiveCfg = Debug|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|Any CPU.Build.0 = Release|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -211,5 +235,7 @@ Global
{5F945B82-FE5F-425C-956C-8BC2F2020254} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1}
{98335B23-E4B9-4CAD-9749-0DED32A659A1} = {32285FA4-6B46-4D6B-A840-2B13E4C8B58E}
{E69FD235-2042-43A4-9970-59CB29955B4E} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1}
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E} = {32285FA4-6B46-4D6B-A840-2B13E4C8B58E}
{5DE8E4D9-AACD-4B5F-819F-F091383FB996} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1}
EndGlobalSection
EndGlobal
80 changes: 79 additions & 1 deletion Mvc.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.22013.1
VisualStudioVersion = 14.0.22209.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{DAAE4C74-D06F-4874-A166-33305D2643CE}"
EndProject
Expand Down Expand Up @@ -92,6 +92,18 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "RazorInstrumentationWebSite
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ApplicationModelWebSite", "test\WebSites\ApplicationModelWebSite\ApplicationModelWebSite.kproj", "{CAE52CB7-0FAC-4B5B-8251-B0FF837DB657}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Mvc.WebApiCompatShim", "src\Microsoft.AspNet.Mvc.WebApiCompatShim\Microsoft.AspNet.Mvc.WebApiCompatShim.kproj", "{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApiCompatShimWebSite", "test\WebSites\WebApiCompatShimWebSite\WebApiCompatShimWebSite.kproj", "{B2B7BC91-688E-4C1E-A71F-CE948D958DDF}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Mvc.WebApiCompatShimTest", "test\Microsoft.AspNet.Mvc.WebApiCompatShimTest\Microsoft.AspNet.Mvc.WebApiCompatShimTest.kproj", "{5DE8E4D9-AACD-4B5F-819F-F091383FB996}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TagHelperSample.Web", "samples\TagHelperSample.Web\TagHelperSample.Web.kproj", "{2223120F-D675-40DA-8CD8-11DC14A0B2C7}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Mvc.TagHelpers", "src\Microsoft.AspNet.Mvc.TagHelpers\Microsoft.AspNet.Mvc.TagHelpers.kproj", "{B2347320-308E-4D2B-AEC8-005DFA68B0C9}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Mvc.TagHelpers.Test", "test\Microsoft.AspNet.Mvc.TagHelpers.Test\Microsoft.AspNet.Mvc.TagHelpers.Test.kproj", "{860119ED-3DB1-424D-8D0A-30132A8A7D96}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -482,6 +494,66 @@ Global
{CAE52CB7-0FAC-4B5B-8251-B0FF837DB657}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{CAE52CB7-0FAC-4B5B-8251-B0FF837DB657}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{CAE52CB7-0FAC-4B5B-8251-B0FF837DB657}.Release|x86.ActiveCfg = Release|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|x86.ActiveCfg = Debug|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|Any CPU.Build.0 = Release|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|x86.ActiveCfg = Release|Any CPU
{B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Debug|x86.ActiveCfg = Debug|Any CPU
{B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Release|Any CPU.Build.0 = Release|Any CPU
{B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Release|x86.ActiveCfg = Release|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|x86.ActiveCfg = Debug|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|Any CPU.Build.0 = Release|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|x86.ActiveCfg = Release|Any CPU
{2223120F-D675-40DA-8CD8-11DC14A0B2C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2223120F-D675-40DA-8CD8-11DC14A0B2C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2223120F-D675-40DA-8CD8-11DC14A0B2C7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{2223120F-D675-40DA-8CD8-11DC14A0B2C7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{2223120F-D675-40DA-8CD8-11DC14A0B2C7}.Debug|x86.ActiveCfg = Debug|Any CPU
{2223120F-D675-40DA-8CD8-11DC14A0B2C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2223120F-D675-40DA-8CD8-11DC14A0B2C7}.Release|Any CPU.Build.0 = Release|Any CPU
{2223120F-D675-40DA-8CD8-11DC14A0B2C7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{2223120F-D675-40DA-8CD8-11DC14A0B2C7}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{2223120F-D675-40DA-8CD8-11DC14A0B2C7}.Release|x86.ActiveCfg = Release|Any CPU
{B2347320-308E-4D2B-AEC8-005DFA68B0C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2347320-308E-4D2B-AEC8-005DFA68B0C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2347320-308E-4D2B-AEC8-005DFA68B0C9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{B2347320-308E-4D2B-AEC8-005DFA68B0C9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{B2347320-308E-4D2B-AEC8-005DFA68B0C9}.Debug|x86.ActiveCfg = Debug|Any CPU
{B2347320-308E-4D2B-AEC8-005DFA68B0C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2347320-308E-4D2B-AEC8-005DFA68B0C9}.Release|Any CPU.Build.0 = Release|Any CPU
{B2347320-308E-4D2B-AEC8-005DFA68B0C9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{B2347320-308E-4D2B-AEC8-005DFA68B0C9}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{B2347320-308E-4D2B-AEC8-005DFA68B0C9}.Release|x86.ActiveCfg = Release|Any CPU
{860119ED-3DB1-424D-8D0A-30132A8A7D96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{860119ED-3DB1-424D-8D0A-30132A8A7D96}.Debug|Any CPU.Build.0 = Debug|Any CPU
{860119ED-3DB1-424D-8D0A-30132A8A7D96}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{860119ED-3DB1-424D-8D0A-30132A8A7D96}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{860119ED-3DB1-424D-8D0A-30132A8A7D96}.Debug|x86.ActiveCfg = Debug|Any CPU
{860119ED-3DB1-424D-8D0A-30132A8A7D96}.Release|Any CPU.ActiveCfg = Release|Any CPU
{860119ED-3DB1-424D-8D0A-30132A8A7D96}.Release|Any CPU.Build.0 = Release|Any CPU
{860119ED-3DB1-424D-8D0A-30132A8A7D96}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{860119ED-3DB1-424D-8D0A-30132A8A7D96}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{860119ED-3DB1-424D-8D0A-30132A8A7D96}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -526,5 +598,11 @@ Global
{0EF9860B-10D7-452F-B0F4-A405B88BEBB3} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{2B2B9876-903C-4065-8D62-2EE832BBA106} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{CAE52CB7-0FAC-4B5B-8251-B0FF837DB657} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{23D30B8C-04B1-4577-A604-ED27EA1E4A0E} = {32285FA4-6B46-4D6B-A840-2B13E4C8B58E}
{B2B7BC91-688E-4C1E-A71F-CE948D958DDF} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C}
{5DE8E4D9-AACD-4B5F-819F-F091383FB996} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1}
{2223120F-D675-40DA-8CD8-11DC14A0B2C7} = {DAAE4C74-D06F-4874-A166-33305D2643CE}
{B2347320-308E-4D2B-AEC8-005DFA68B0C9} = {32285FA4-6B46-4D6B-A840-2B13E4C8B58E}
{860119ED-3DB1-424D-8D0A-30132A8A7D96} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace MvcSample.Web.ApiExplorerSamples
[Route("api/Products")]
public class ProductsController : Controller
{
[HttpGet("{id}")]
[HttpGet("{id:int}")]
public Product GetById(int id)
{
return null;
Expand All @@ -22,7 +22,7 @@ public IEnumerable<Product> SearchByName(string name)
}

[Produces("application/json", Type = typeof(ProductOrderConfirmation))]
[HttpPut("{id}/Buy")]
[HttpPut("{id:int}/Buy")]
public IActionResult Buy(int projectId, int quantity = 1)
{
return null;
Expand Down
4 changes: 2 additions & 2 deletions samples/MvcSample.Web/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void Configure(IApplicationBuilder app)
// Setup services with a test AssemblyProvider so that only the
// sample's assemblies are loaded. This prevents loading controllers from other assemblies
// when the sample is used in the Functional Tests.
services.AddTransient<IControllerAssemblyProvider, TestAssemblyProvider<Startup>>();
services.AddTransient<IAssemblyProvider, TestAssemblyProvider<Startup>>();
services.ConfigureOptions<MvcOptions>(options =>
{
options.Filters.Add(typeof(PassThroughAttribute), order: 17);
Expand Down Expand Up @@ -81,7 +81,7 @@ public void Configure(IApplicationBuilder app)
// Setup services with a test AssemblyProvider so that only the
// sample's assemblies are loaded. This prevents loading controllers from other assemblies
// when the sample is used in the Functional Tests.
services.AddTransient<IControllerAssemblyProvider, TestAssemblyProvider<Startup>>();
services.AddTransient<IAssemblyProvider, TestAssemblyProvider<Startup>>();

services.ConfigureOptions<MvcOptions>(options =>
{
Expand Down
2 changes: 1 addition & 1 deletion samples/MvcSample.Web/TestAssemblyProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace MvcSample.Web
/// This is a generic type because it needs to instantiated by a service provider to replace
/// a built-in MVC service.
/// </remarks>
public class TestAssemblyProvider<T> : IControllerAssemblyProvider
public class TestAssemblyProvider<T> : IAssemblyProvider
{
public TestAssemblyProvider()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
<ul>
@foreach (var parameter in Model.ParameterDescriptions)
{
<li>@parameter.Name - @parameter.Type.FullName - @parameter.Source.ToString()</li>
<li>
@parameter.Name - @(parameter?.Type?.FullName ?? "Unknown") - @parameter.Source.ToString()
- Constraint: @(parameter?.Constraint?.GetType()?.Name?.Replace("RouteConstraint", "") ?? " none")
- Default value: @(parameter?.DefaultValue ?? " none")
</li>
}
</ul>
}
Expand All @@ -22,7 +26,7 @@
{
<p>Response Formats:</p>
<ul>
@foreach(var response in Model.SupportedResponseFormats)
@foreach (var response in Model.SupportedResponseFormats)
{
<li>@response.MediaType.RawValue - @response.Formatter.GetType().Name</li>
}
Expand Down
5 changes: 2 additions & 3 deletions samples/MvcSample.Web/Views/Home/FlushPoint.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@
<strong>Marketing:</strong> <a href="mailto:[email protected]">[email protected]</a>
</address>

@* Remove the Wait() calls once we add support for async sections *@
@{
FlushAsync().Wait();
Task.Delay(TimeSpan.FromSeconds(1)).Wait();
await FlushAsync();
await Task.Delay(TimeSpan.FromSeconds(1));
}
<div class="row">
<div class="col-md-6">
Expand Down
4 changes: 2 additions & 2 deletions samples/MvcSample.Web/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
body { padding-top: 0px; }
}
</style>
@RenderSection("header", required: false)
@await RenderSectionAsync("header", required: false)
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
Expand All @@ -37,6 +37,6 @@
<p>&copy; @DateTime.Now.Year - My ASP.NET Application</p>
</footer>
</div>
@RenderSection("footer", required: false)
@await RenderSectionAsync("footer", required: false)
</body>
</html>
75 changes: 75 additions & 0 deletions samples/TagHelperSample.Web/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@

using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Rendering;
using TagHelperSample.Web.Models;

namespace TagHelperSample.Web.Controllers
{
public class HomeController : Controller
{
private static readonly IEnumerable<SelectListItem> _items = new SelectList(Enumerable.Range(7, 13));
private static readonly Dictionary<int, User> _users = new Dictionary<int, User>();
private static int _next;

public HomeController()
{
// Unable to set ViewBag from constructor. Does this work in MVC 5.2?
////ViewBag.Items = _items;
}

// GET: /<controller>/
public IActionResult Index()
{
return View(_users.Values);
}

// GET: /Home/Create
public IActionResult Create()
{
ViewBag.Items = _items;
return View();
}

// POST: Home/Create
[HttpPost]
public IActionResult Create(User user)
{
if (user != null && ModelState.IsValid)
{
var id = _next++;
user.Id = id;
_users[id] = user;
return RedirectToAction("Index");
}

ViewBag.Items = _items;
return View();
}

// GET: /Home/Edit/5
public IActionResult Edit(int id)
{
User user;
_users.TryGetValue(id, out user);

ViewBag.Items = _items;
return View(user);
}

// POST: Home/Edit/5
[HttpPost]
public IActionResult Edit(int id, User user)
{
if (user != null && id == user.Id && _users.ContainsKey(id) && ModelState.IsValid)
{
_users[id] = user;
return RedirectToAction("Index");
}

ViewBag.Items = _items;
return View();
}
}
}
18 changes: 18 additions & 0 deletions samples/TagHelperSample.Web/Models/User.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

using System;

namespace TagHelperSample.Web.Models
{
public class User
{
public int Id { get; set; }

public string Name { get; set; }

public string Blurb { get; set; }

public DateTimeOffset DateOfBirth { get; set; }

public int YearsEmployeed { get; set; }
}
}
15 changes: 15 additions & 0 deletions samples/TagHelperSample.Web/Startup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

using Microsoft.AspNet.Builder;
using Microsoft.Framework.DependencyInjection;

namespace TagHelperSample.Web
{
public class Startup
{
public void Configure(IApplicationBuilder app)
{
app.UsePerRequestServices(services => services.AddMvc());
app.UseMvc();
}
}
}
18 changes: 18 additions & 0 deletions samples/TagHelperSample.Web/TagHelperSample.Web.kproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>2223120f-d675-40da-8cd8-11dc14a0b2c7</ProjectGuid>
<OutputType>Web</OutputType>
<RootNamespace>TagHelperSample.Web</RootNamespace>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
<DevelopmentServerPort>31726</DevelopmentServerPort>
</PropertyGroup>
<Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
Loading