Commit Graph

267 Commits

Author SHA1 Message Date
Pranav K 36413b4d81 Removing XmlSerializer from TagHelpersSample.Web 2015-01-23 17:26:48 -08:00
Pranav K f93d0d82c3 Merge branch 'release' into dev 2015-01-23 17:12:16 -08:00
Pranav K 071c697318 Modify BuilderExtensions.UseMvc to not add any routes by default
Fixes #1879
2015-01-23 16:51:38 -08:00
Pranav K 4d77f670f6 Merge branch 'release' into dev 2015-01-22 16:47:54 -08:00
Pranav K 6c21b40894 EntryLinkHelpers.ContentLink should be available to use for user code
inside of a cache tag helper's body.

Fixes: #1867
2015-01-22 16:37:11 -08:00
Kiran Challa 5c2dc5db11 [Fixes#1792]Separate XML serializers to Microsoft.AspNet.Mvc.Xml 2015-01-22 15:09:20 -08:00
Ryan Nowak 7fbe0ce307 Merge branch 'release' into dev 2015-01-22 14:02:17 -08:00
Ryan Nowak 09928a2818 Adds parameter information to ApiExplorer
This change makes ApiDescription and ApiParameterDescription aware of all
of the new features we built into model binding for enhanced DTO support
(uber-binding).

The main change is that instead of sticking just to the declared
parameters on the action itself, we now traverse model metadata and break
the parameters down based on their logical data source.

This means that a model like the below will yield 3 parameters:

public class ProductChangeCommandDTO
{
    public int Id { get; set; }

    [FromBody]
    public ProductDetails Changes { get; set; }

    [FromQuery]
    public string AdminComments { get; set; }

    [FromServices]
    public IProductRepository Repository { get; set; }
}

The 'Repository' will be hidden, as it's not related to user input.

Additionally, we treat different sources differently. In the
above example, 'Changes' is from the body and will be treated as a
leaf-node.

However if you use nested DTOs that are bound from the query string (using
[FromQuery]) or similar, we'll recursively explore to find as much
structure as possible.

This information is combined with data from the route template to give a
much more complete picture than we ever could in the past for parameters,
especially when DTO/Command pattern is used.
2015-01-22 13:30:41 -08:00
damianedwards 759fbbd661 Added the EnvironmentTagHelper:
- #1553
2015-01-22 10:17:25 -08:00
Doug Bunting 54f88ab190 [cleanup] Update .gitignore and reset .kproj files
- add a couple more exclusions to .gitignore (recent VS additions)
- remove `<ProjectExtensions/>` elements
- update files that don't have the correct output directories
- remove dangling PrecompilationWebSite.kproj file
2015-01-21 22:03:23 -08:00
N. Taylor Mullen 7b52559366 Modify TagHelpers to use new content mode design.
- React to aspnet/Razor#221
- Modified existing TagHelpers to no longer rely on ContentBehavior and to instead utilize GetChildContentAsync, PreContent, Content and PostContent.
2015-01-16 15:50:27 -08:00
Doug Bunting 9b2a9e3976 Change `ValidationSummaryTagHelper`'s property to `ValidationSummary` enum
- #1685
- move `ValidationSummary` type to the `Microsoft.AspNet.Mvc` namespace
- update tests and samples to match
- remove tests for case-insensitivity of `ValidationSummary` property values
2015-01-16 15:09:27 -08:00
Hao Kung 7b2fb55ef6 React to Security Auth changes 2015-01-15 23:41:52 -08:00
Doug Bunting a77d071830 React to aspnet/Razor#268 changes
- part I of #1253 using new Razor capabilities
- update baselines to match latest code generation
- use new `CodeBuilderContext` and `TagHelperAttributeValueCodeRenderer` signatures
- test complex expressions in bound non-string attribute values
2015-01-15 16:47:22 -08:00
Kiran Challa 02f4ca9f05 [Fixes #1791]Remove XML formatter from defaults 2015-01-15 15:46:49 -08:00
Ajay Bhargav Baaskaran 437eb93bde File upload model binder
- Support for binding posted file to type IFormFile
- Support for multipart/form-data in FormValueProviderFactory
- Updated Mvc Sample
- Added relevant unit and functional tests
2015-01-15 13:41:14 -08:00
Chris Ross 91d7e382d1 Consume new strongly typed headers. Remove temp implementations. 2015-01-14 15:51:34 -08:00
Doug Bunting 6e68637af1 Nit: Remove unneeded sample dependencies on Microsoft.AspNet.Mvc.TestConfiguration 2015-01-13 12:49:22 -08:00
Ryan Nowak 5dfd27e51f Removing dead code in sample 2014-12-31 11:26:49 -08:00
riande db96104985 removed App_data per [Mvc] Remove App_Data from MvcSample.Web Startup (#1716) 2014-12-31 11:09:03 -08:00
Kai Ruhnau e0beec90f4 Fixed folder name casing of Compiler/* 2014-12-16 12:32:35 -08:00
Ryan Nowak e65218d6df Adding servers and wwwroot folder to test websites
Adding dependencies and commands for iis, web listener and khestrel to each
site.

Each website comes with a readme.md to 'anchor' the otherwise empty
folder. We have another work item tracking adding content to these.

Once VS sees a project with a wwwroot, it wants to assign a port for iis,
so I let it.
2014-12-10 14:16:11 -08:00
SonjaKhan 66eb3af806 random cleanup 2014-12-09 10:55:22 -08:00
Doug Bunting f94bd53464 Add functional test of MVC tag helper sample
- ensure future changes don't break this sample
2014-12-05 15:48:43 -08:00
Doug Bunting 27beca7738 Fix #1618, Add asp- prefix to custom attributes of MVC tag helpers
- update XML docs to reflect new HTML / custom attribute separation
- update `Exception` messages to use new attribute names
- update MVC tag helper sample to use new custom attribute names
- add missing `<input/>` tag helper `throw`s test

nits:
- reword a few comments and messages for clarity and consistency
- use `<exception/>` sections to describe what's thrown
- add "Reviewers" comments about current throws
 - note `<a/>` and `<form/>` are slightly inconsistent with others: `throw`
   if unable to override specified `href` or `action` attributes; rest
   `throw` only if custom attributes are inconsistent e.g. `<input/>` with
   `asp-format` but no `asp-for`
- create test tag helpers after all property values are available
2014-12-05 15:48:33 -08:00
Doug Bunting 69f63db7bf Add out-of-order HTML attributes to MVC tag helper sample
- these are rendered in the same, non-alphabetic order
- demonstrates aspnet/Razor#225 does not affect HTML attributes
2014-12-05 15:48:23 -08:00
Kirthi Krishnamraju d8455c3e64 Make Flush work without requiring curly braces
Fixes #1547
2014-12-05 14:53:09 -08:00
Pranav K 933f7eeb22 Layout specification and discovery should follow the same behavior as
partials

Fixes #1047
2014-12-03 11:54:46 -08:00
Pranav K 765f113515 Checkin VS auto-modifications to kproj files 2014-12-03 11:11:43 -08:00
Doug Bunting 1431d1ae0b Quit fighting VisualStudio
- let it reformat project file and add `<DevelopmentServerPort/>` element
2014-11-30 20:37:05 -08:00
Anuraj 680cdf4d57 Update Project.json to download TagHelpers assembly 2014-11-26 16:00:07 -08:00
Ajay Bhargav Baaskaran 9f1cb655f6 matched classnames with filenames 2014-11-25 11:21:17 -08:00
Victor Hurdugaci 99b5f430ff Add schema version to kproj files 2014-11-25 10:57:58 -08:00
Doug Bunting a42fa3c800 Touch up tag helper sample
- provide list of users on Index page
 - currently uses only the `<a/>` helper but left `<label/>` and `<input/>` comments
- get date picker working on Create and Edit pages
 - add `[DataType]` annotation
 - use format browsers recognize

nits:
- move "Create New" link to the bottom of `~/Home/Index`
- correct code comment about assigning to a `ViewBag` property
2014-11-22 11:42:17 -08:00
Doug Bunting ab8a77bb70 Avoid NREs in MVC sample
- see e.g. results of `GET ~/Home/Post`
- use parentheses to avoid `?` confusing Razor

nit: remove unused Home/Test.cshtml view
2014-11-22 10:36:39 -08:00
Doug Bunting 7eb106676c Add missing license headers
- #EngineeringDay
- license present but incorrect in just a few files
- skip generated files such as Resources.Designer.cs and files under
  test\Microsoft.AspNet.Mvc.Razor.Host.Test\TestFiles\Output
2014-11-20 22:54:05 -08:00
Doug Bunting 315908af5f Apply VS' FormatDocument and RemoveAndSort to all *.cs files
- #EngineeringDay
- VS does not yet format auto-properties nicely; reverted what it did

Also revert changes under
- test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles
2014-11-20 21:15:46 -08:00
Hao Kung d9893b260a React to fallback changes 2014-11-20 17:43:55 -08:00
Doug Bunting 5e067cdb9e Delete trailing whitespace
- #EngineeringDay
- Total replaced: 660  Matching files: 270 in *.cs
- Total replaced: 250  Matching files: 32 in all other files
- Total replaced: 22  Matching files: 8 in a few stragglers

Did not change files under following directories
- test\Microsoft.AspNet.Mvc.Razor.Host.Test\TestFiles\Output
- test\Microsoft.AspNet.Mvc.FunctionalTests\compiler\resources
- test\WebSites\TagHelpersWebSite
(Razor generates trailing whitespace in a case or two)
2014-11-20 16:18:09 -08:00
Ryan Nowak 7c961e3ce8 TODO removal
For each of these TODOs:

- If there's an active bug tracking the work, and the TODO provides
  something of value, I left it and standardized the formatting. I also
  added comments to the bug.

- If the comment provided no value (implement feature X when we do feature
  X), I deleted it with impunity.

- If the comment was stale (won't fix or just out of date), then we
  removed it uncerimoniously.

There was a single TODO that was actually actionable, so I enabled that
test.
2014-11-20 15:01:35 -08:00
Ryan Nowak 38b3b61485 update due to breaking changes in routing 2014-11-18 12:37:47 -08:00
Doug Bunting 687b174b63 Accept VS changes to avoid noise later 2014-11-04 22:42:51 -08:00
Doug Bunting f7ef604b86 Regenerate .kproj files
- does not seem to have a negative impact
- e.g. sample web projects run / debug fine
2014-11-04 22:41:53 -08:00
Pranav K 3aaeebd9c5 Revert "Revert "Added a functional test for view precompilation""
This reverts commit 6b2ab32885.
2014-10-30 14:38:44 -07:00
jacalvar 6b2ab32885 Revert "Added a functional test for view precompilation"
This reverts commit 310feeb826.
2014-10-28 19:14:50 -07:00
jacalvar 310feeb826 Added a functional test for view precompilation 2014-10-28 18:38:15 -07:00
Doug Bunting 1f670bf3a7 Merge branch 'release' into dev 2014-10-27 16:43:02 -07:00
Doug Bunting 4bde6f6caf Add "/home/nulluser" view to MVC sample
- exercises display and editor helpers when `Model==null`
2014-10-27 16:25:48 -07:00
Ryan Nowak 0a3ad09466 Rename GlobalModel -> ApplicationModel
This also comes with a rename of the namespace
Microsoft.AspNet.Mvc.ApplicationModel to
Microsoft.AspNet.Mvc.ApplicationModels.

Also tuned up some parameter and variable names for increased
understandability.
2014-10-23 16:03:55 -07:00
Ryan Nowak df8f84b772 Fix #1287 - Port WebAPI parameter binding behavior
This change modifies the default parameter binding behavior for an
ApiController to use the WebAPI rules.

'simple types' default to use route data or query string
'complex types' default to use the body (formatters)

Adds ModelBindingAttribute to enabled model binding
2014-10-17 16:51:48 -07:00