Commit Graph

724 Commits

Author SHA1 Message Date
Pranav K df0b33a378 Updating ViewStartUtility to use IFileSystem.TryGetParentPath 2014-09-05 14:38:11 -07:00
David Fowler 103693b61c Updated build.cmd 2014-09-05 01:50:09 -07:00
sornaks 28e334d3db Issue #668: Sample should be covered by a basic functional test. 2014-09-04 14:07:46 -07:00
David Fowler 34add2249e Updated to use the new target framework in project.json 2014-09-04 02:02:40 -07:00
jacalvar b6fb7ac7df Take advantage of nameof to improve our usage of MemberData across the code base.
Substituted all instances of [MemberData("PropertyName")] for [MemberData(nameof(PropertyName))]
This change enables us to take advantage of IDE features like Navigate to source,
find all references, etc. When using Visual Studio.
2014-09-02 13:53:03 -07:00
Pranav K b8692c2c21 Updating FunctionalTests to use HttpClient abstractions 2014-09-01 11:16:54 -07:00
jacalvar ccc20a38c1 [Fixes #734] Attribute Routing: Implement Name
1. Added support for Name in attribute routing. Name can be defined using [RouteAttribute]
and the different Http*Attributes, for example [HttpGet].

2. Names defined on actions always override names defined on the controller.

3. Actions with a non empty template don't inherit the name from the controller. The name
   is only inherited from the controller when the action template is null or empty.

4. Multiple attribute routes with different templates and the same name are not allowed.
2014-08-29 17:51:12 -07:00
Pranav K a931e21456 Adding support for flush points in Razor pages
Fixes #1042
2014-08-29 09:30:23 -07:00
David Fowler 88eb29b5d0 Changed remaining ifdefs from K10 and ASPNETCORE50 2014-08-28 22:39:13 -07:00
David Fowler 2e6e5307f6 Updated to use the new target framework in project.json 2014-08-28 22:14:10 -07:00
YishaiGalatzer e40dbcaebf Prevent flushing when writing out from the formatters.
Also make the XML formatter respect object as a return type.

Issues: MVC/1073, MVC/972, MVC/958

1072 is a followup work item to add test coverage.
2014-08-28 14:15:07 -07:00
Pranav K ddea73b934 Fixing build break by updating comment 2014-08-26 12:14:42 -07:00
Pranav K 5beed03b10 Removing unused namespaces 2014-08-26 11:58:12 -07:00
Pranav K d604c18368 Moving IModelValidatorProvider to Options
Fixes #879
2014-08-26 11:53:32 -07:00
Pranav K d77b06f742 Fixing IFileSystem in Razor test 2014-08-26 10:30:08 -07:00
Pranav K b2750752dd Reacting to IFileSystemInfo changes 2014-08-26 09:52:52 -07:00
Pranav K 096ba08a8d Reacting to IFileSystemInfo changes 2014-08-26 09:48:19 -07:00
harshgMSFT 313a537ea1 Adding ModelStateError if there is no input formatter selected. 2014-08-22 16:52:58 -07:00
Ryan Nowak 9faca78a84 Optimize attribute routing link generation 2014-08-22 15:28:19 -07:00
Pranav K 2dcbbf70b0 Modifying RazorViewEngine to create IRazorView instances from service
container
2014-08-22 11:41:04 -07:00
Shannon Deminick f6547d63e8 Update RazorView.RenderAsync to be virtual
Would be nice if this method is virtual so people can extend the RazorView easily, this functionality is available in the current MVC which I utilize.
2014-08-22 11:17:15 -07:00
Pranav K a490abc6e8 Adding support for inheriting chunks from _ViewStarts as part of host
parsing.

Fixes #881
2014-08-22 11:04:42 -07:00
dougbu 7a1242f162 Remove `using` for Microsoft.AspNet.Mvc.Razor namespace from views
- eventually will clean up IntelliSense -- removing classes users don't
  need when editing a view
- will _not_ cleanup IntelliSense 'til VS stops using a private copy of
  Microsoft.AspNet.Mvc.Razor.Host.dll or we update that copy
- all tests and MVC sample views still work fine
- issue #969
2014-08-21 14:26:40 -07:00
sornaks 791518d44d Issue #347: Throw a better exception when the user didn't add the MVC services.
Introducing MarkerService for identifying if MvcServices were added.
2014-08-21 13:59:52 -07:00
Pranav K eccd25bedd Change ThrowIfFaulted to WaitAndThrowIfFaulted 2014-08-21 11:55:41 -07:00
Pranav K 9c4df4606f Modify TemplateRenderer to use ThrowIfFaulted instead of Task.Wait
Fixes #782
2014-08-21 08:38:12 -07:00
Chris Ross 76ecb73040 Fix abstractions break in tests. 2014-08-20 14:33:39 -07:00
sornaks b9f1586008 Changes to introduce CanWriteResult for Xml OutputFormatters. 2014-08-20 11:09:09 -07:00
dougbu 041d350d51 Test data/time templates
- focus on affect of `ModelMetadata.HasNonDefaultEditFormat` and
  `IHtmlHelper.Html5DateRenderingMode`
- work through `TemplateRenderer` because individual templates only do
  formatting in a few cases
2014-08-20 10:08:23 -07:00
dougbu 0b548997d2 Back `HtmlHelper.Html5DateRenderingMode` with new `ViewContext` property
- provides expected scoped semantics
- helps a bit with #448 but does not provide an app-wide default
2014-08-20 10:08:12 -07:00
dougbu dfcd5fe9a9 Address TODO item with new `HasNonDefaultEditFormat`
- avoid overriding a datetime format if format was already customized
- primarily affects the default Date and Time editor templates because they
  are often used due to `[DataType]` attributes with "default" edit formats
2014-08-20 10:08:00 -07:00
dougbu 98e23075dd Test `DisplayFormatString`, `EditFormatString`, and `HasNonDefaultEditFormat`
- `DisplayFormatString` and `EditFormatString` now based on attributes
- `HasNonDefaultEditFormat` is new
- confirm `DataType` and `ScaffoldColumn` in `CachedDataAnnotationsMetadataAttributes`
2014-08-20 10:07:55 -07:00
dougbu 0595e9ebc9 Move two recently-added `[HiddenInput]` tests into `CachedDataAnnotationsModelMetadataProviderTest` 2014-08-20 10:07:49 -07:00
dougbu 4351ddd092 Add `ModelMetadata.HasNonDefaultEditFormat` property
- add `DataType` property to `CachedDataAnnotationsMetadataAttributes` in support of `ComputeHasNonDefaultEditFormat()`
- provide doc comments and flesh out the implementation of `DisplayFormatString` and `EditFormatString`

nits:
- add comment about _not_ overriding `ComputeIsComplexType()` in `CachedDataAnnotationsModelMetadata`
- restore alphabetic order in `CachedDataAnnotationsMetadataAttributes`
- seal `SimpleDisplayText` in `CachedModelMetadata<TPrototypeCache>`, matching MVC 5.2
2014-08-20 10:07:36 -07:00
Pranav K a3ab95713e Reacting to System.IO package version change 2014-08-20 06:56:35 -07:00
dougbu 266644560f Clean up `AssociatedMetadataProviderTest`
- remove unused nested class `ModelWithReadOnlyProperty`
- remove unecessary nested classes `RangeAttribute` and `RequiredAttribute`
- use `Assert.NotEmpty()` and `Assert.Single()` where appropriate
2014-08-19 15:49:06 -07:00
jacalvar 2eec0bbf6d [Fixes #1035] RouteGroupConstraint should only be added once for non attribute routed actions
1. Changed ReflectedActionDescriptorProvider to add RouteGroupConstraint only once
   for non attribute routed actions.

2. Added tests to cover the scenario.
2014-08-19 13:14:56 -07:00
harshgMSFT 6f0fa67170 Enabling basic input formatter selection.
Conflicts:
	Mvc.sln
	src/Microsoft.AspNet.Mvc.Core/Formatters/TempInputFormatterProvider.cs
	src/Microsoft.AspNet.Mvc.Core/Microsoft.AspNet.Mvc.Core.kproj
	src/Microsoft.AspNet.Mvc.Core/ReflectedActionInvoker.cs
	src/Microsoft.AspNet.Mvc.Core/ReflectedActionInvokerProvider.cs
	src/Microsoft.AspNet.Mvc/MvcServices.cs
	test/Microsoft.AspNet.Mvc.Core.Test/Microsoft.AspNet.Mvc.Core.Test.kproj
	test/Microsoft.AspNet.Mvc.Core.Test/ReflectedActionInvokerTest.cs

Conflicts:
	src/Microsoft.AspNet.Mvc.Core/Formatters/TempInputFormatterProvider.cs
2014-08-19 12:46:52 -07:00
Pranav K 764b1e64b8 RoslynCompilationService should set the generated code when compilation is successful
Fixes #895
2014-08-19 09:24:28 -07:00
harshgMSFT 64d797a489 1. Moving input formatting related classes to MVC Core.(for tests as well).
2. Cleaning up the IInputFormatter to the final version.
3. Updating the input formatters and the context to be compliant with the IInputFormatter interface.
4. Adding Functional Tests.
- Not cleaning up TempInputFormatterProvider.

Conflicts:
	src/Microsoft.AspNet.Mvc.Core/Formatters/InputFormatter.cs
	src/Microsoft.AspNet.Mvc.Core/Formatters/JsonInputFormatter.cs
	src/Microsoft.AspNet.Mvc.Core/Formatters/TempInputFormatterProvider.cs
	src/Microsoft.AspNet.Mvc.Core/Formatters/XmlDataContractSerializerInputFormatter.cs
	src/Microsoft.AspNet.Mvc.Core/Formatters/XmlSerializerInputFormatter.cs
	src/Microsoft.AspNet.Mvc.Core/Microsoft.AspNet.Mvc.Core.kproj
	src/Microsoft.AspNet.Mvc.Core/ReflectedActionInvoker.cs
	src/Microsoft.AspNet.Mvc.ModelBinding/Microsoft.AspNet.Mvc.ModelBinding.kproj
	test/Microsoft.AspNet.Mvc.Core.Test/Microsoft.AspNet.Mvc.Core.Test.kproj

Conflicts:
	src/Microsoft.AspNet.Mvc.Core/Microsoft.AspNet.Mvc.Core.kproj
	src/Microsoft.AspNet.Mvc.HeaderValueAbstractions/Microsoft.AspNet.Mvc.HeaderValueAbstractions.kproj
	src/Microsoft.AspNet.Mvc.ModelBinding/Microsoft.AspNet.Mvc.ModelBinding.kproj
	src/Microsoft.AspNet.Mvc.ModelBinding/ValueProviders/FormValueProviderFactory.cs
	test/Microsoft.AspNet.Mvc.Core.Test/Microsoft.AspNet.Mvc.Core.Test.kproj
	test/Microsoft.AspNet.Mvc.ModelBinding.Test/Microsoft.AspNet.Mvc.ModelBinding.Test.kproj

Conflicts:
	src/Microsoft.AspNet.Mvc.Core/Formatters/FormattingUtilities.cs
	src/Microsoft.AspNet.Mvc.Core/Formatters/TempInputFormatterProvider.cs
2014-08-18 17:07:19 -07:00
Pranav K 4f69e17f53 Reacting to System.IO.FileSystem package version change 2014-08-18 15:10:01 -07:00
harshgMSFT d97a427b3d Adding Input Formatters to MVC Options and using HeaderValueAbstractions 2014-08-18 10:25:19 -07:00
harshgMSFT 944fafb589 Fixing sample 2014-08-17 01:34:13 -07:00
Louis DeJardin 5de2bc8243 Implementing ILoggerFactory.AddProvider 2014-08-15 16:34:14 -07:00
harshgMSFT bb452f19a7 JsonResult to use ObjectResult for content negotiation to pick default json formatter. 2014-08-15 15:56:24 -07:00
sornaks 2920c55116 Changes to enable XML Output Formatters.
- Unit / Functional tests for the same.
2014-08-15 15:05:00 -07:00
dougbu 1a4bd25e0f Add `[HiddenInput]`, `ModelMetadata.HideSurroundingHtml`, and `.Properties` tests
nits:
- add a few missing default `ModelMetadata` property value checks
- cleanup some redundancies in test data initializers
2014-08-15 12:33:58 -07:00
dougbu c0179f74cc Do not repeatedly evaluate `ModelMetadata.Properties` enumeration
- supports useful property updates of `ModelMetadata` instances in the collection
- provide a controllable ordering using the `Order` value
- part of #964
2014-08-15 12:33:22 -07:00
dougbu 53432e1483 Address TODO item in default `object` editor template
- add validation elements per property in this template
- update editor template test to expect new `<span>` in result
2014-08-15 10:50:20 -07:00
dougbu 796ff1d3d3 Add `HideSurroundingHtml` property to `ModelMetadata`
- #843
- add property as well as the related `[HiddenInput]` attribute
- use this property to address some TODOs in default display and editor templates
2014-08-15 10:50:17 -07:00