Commit Graph

18 Commits

Author SHA1 Message Date
sornaks eeabe27606 Including Mvc.js script which enables Mvc.stringify(data) used in JQuery.Post() to send data understandable by MVC.
Adding Bower and Grunt components to pull JQuery from an appropriate source. Addressing PR Comments.
2015-03-05 08:07:01 -08:00
Mugdha Kulkarni 6a0f471a42 Adding ClearMediaTypeMappingForFormat to FormatterMappings and other PR comments 2015-01-31 23:18:24 -08:00
Mugdha Kulkarni c8b911b596 Adding functional tests and attribute route tests.
Incorporating PR coments.
2015-01-31 23:15:13 -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
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
Ryan Nowak 3cd6d3e060 Adding Api Explorer 2014-09-25 15:31:51 -07:00
sornaks 28516a0ae9 Changes to support DisplayColumn attribute. Updating the MvcSample as well to start using DisplayColumn attribute. Adding UnitTests for the same. 2014-06-10 16:45:55 -07:00
Andrew Peters f13865dedc Updating copyright headers 2014-05-08 23:01:20 -07:00
dougbu 67b33868a3 Add `ListBox()` and `ListBoxFor()` helper methods
- copy from legacy MVC
- get `ListBox[For]()` methods in correct places and working
 - also usual stuff: `var`, `[NotNull]`, remove `IDictionary<,>` overloads
 - `ListBoxHelper()` -> `GenerateListBox`
 - already had all the bits needed in `GenerateSelect()`
- special-case `null` or empty `name` in GenerateSelect()
 - ensure `ArgumentException` has correct parameter name
 - lower-level problem affected `CheckBox()` as well
- use `ListBox()` and `ListBoxFor()` in MVC sample
 - use `ListBox()` in an editor template
2014-05-05 14:26:06 -07:00
anpete 8208cd6b2f Update file headers 2014-05-01 17:42:33 -07:00
sornaks 185ad31491 Adding an appropriate sample to use ValidationMessage and ValidationMessageFor. 2014-04-30 11:07:02 -07:00
sornaks d63d998e95 Introducing DisplayText, DisplayTextFor, Id, IdFor, IdForModel.
Fixing CachedDataAnnotationsModelMetadata to support NullDisplayText.
2014-04-30 10:23:25 -07:00
sornaks 112a5ddc50 Changes enabling TextArea, TextAreaFor.
Changing the interface to directly include Rows and Columns.
2014-04-30 09:42:07 -07:00
Yishai Galatzer bcd0974823 Make the controller available to filters + Sample
GitHub WebFX #300
2014-04-29 10:33:21 -07:00
dougbu f0a97772f5 Add remaining HTML input helpers
- add `CheckBox[For]()`, `Hidden[For]()`, `Password[For]()`, and
  `RadioButton[For]()`
- also make `FormatValue()` visible to users, as it is in legacy MVC
- and spread the boxes out a bit in MyView 😺
2014-04-09 12:52:47 -07:00
N. Taylor Mullen 5dbd006165 Add sample for Display Html Helper.
Showcased a lot of the core pieces of Display in the sample.  Some pieces are still missing such as DataType handling.  The infrastructure is there to handle it in the TemplateRenderer but the model metadata providers do not construct the metadata with the data types.
2014-04-06 15:56:08 -07:00
David Fowler 930986d6a2 Migrate samples from hacky self host to helios
- MvcSample should be deleted and all new code should be written in MvcSample.Web
2014-03-14 10:25:13 -07:00