Commit Graph

25 Commits

Author SHA1 Message Date
Ryan Nowak e91ce4560f Fix #2338 - Add ViewComponentResult
Makes it easier to render a view component from inside a controller. This
makes it possible to implement behavior where an ajax request refreshes
part of a page.
2015-07-23 17:52:52 -07:00
Kirthi Krishnamraju d8a523a07f Added Mvc localization project 2015-07-16 15:57:24 -07:00
Ryan Nowak e985fa5d42 Split up MVC.Extensions into smaller packages
Startup.cs API experience to follow in a separate change. This change just
gets the bulk of the code churn out of the way.
2015-07-06 23:41:22 -07:00
Ajay Bhargav Baaskaran a3cbb1f378 [Fixes #2684] Removed Mvc.Common
- Removed TaskHelper and refactored with ClosedGenericMatcher
 - Removed TypeHelper
 - Moved custom encodings to InputFormatter
 - Moved ObjectToDictionary to PropertyHelper
 - Removed respective tests and test projects
2015-06-25 16:02:07 -07:00
Ryan Nowak faaba481e8 Adding an 'AddMinimalMvc()' for Mvc.Core and sample
This adds the ability to configure Mvc.Core for a project; MVC with
minimal services and dependencies.
2015-06-12 11:29:47 -07:00
Ryan Nowak a679e87a9b Split Mvc.Core
This is the first step is some more refactorings to come in the future
with the goal of making MVC less monolythic. This makes the core of MVC
more reusable and more in line with the design of other vNext platform
components.

With this change, Mvc.Core contains just the minimal guts needed to build
a working app.
- Action Discovery
- Action Invoker
- Filters
- ObjectResult
- Model Metadata
- Model Binding
- Formatters
- Validation System

And yes, we are aware of the irony of 'minimal MVC' not including the view
system. The idea is that this is the kernel of an MVC app, and anything
real is layered on top.

The most noticable impact of this change is that MvcOptions has been blown
apart into more managable chunks. See the various ConfigureMvc*** methods.

The new Mvc.Extensions package is a placeholder while we evaluate and tune
the new definitions. Expect more changes as features are move to their own
packages, and in some case their own repositories.

For now there is no experience to bootstrap an Mvc.Core app. That's coming
next.
2015-06-09 02:12:13 -07:00
Kirthi Krishnamraju 30e54609cc Fix #1911 : Create a separate package for ApiExplorer 2015-04-28 13:13:20 -07:00
Ryan Nowak 9fded74b15 Merging ModelBinding into Mvc.Core 2015-04-27 02:10:37 -07:00
Ryan Nowak 572e57e25c Create Mvc.Abstractions
Creates a new package 'Microsoft.AspNet.Mvc.Abstractions' which defines
APIs and contracts for core concepts and extensibility points in MVC.

Includes:
- ModelBinding
- Validation
- Model State
- Model Metadata
- Action Descriptors
- IActionResult
- Filters
- IActionConstraint
2015-04-27 00:49:14 -07:00
Harsh Gupta 53ef8258bb The model state keys for body bound models which are bound at property will use the entire model name with this change for example
Consider

public class Person
{
    [FromBody]
    public Address Address { get; set; }
}

public class Address
{
   [Required]
   public string Street { get; set; }

   public int Zip { get; set; }
}

Request body { "Zip" : 12345 }
In this case the error key would be "prefix.Address.Street" (assuming there is a prefix because of additional metadata/positioning for/of the Person model).

public class Person
{
       [Required]
       public string Name { get; set; }
}

public void Action([FromBody]Person p)
{
}
Request body { }
In this case the prefix gets ignored and the error key is Name.
Please note this is so that we are compatible with MVC 5.0

public class Person
{
       [Required]
       public string Name { get; set; }
}

public void Action([FromBody][ModelBinder(Name = "prefix")] Person p)
{
}

public void Action2([FromBody][Bind(Name = "prefix")] Person p)
{
}
Request body { }
In both these cases (Action and Action2) the prefix gets ignored and the error key is Name.
This is a slight improvement from mvc, as in MVC the action parameter would be null.

The followup for this would be to fix #2416 -
This PR ignores the validation assuming that #2416 will address the issues and update the test.

NOTE: previous versions of mvc did not have property binding and hence there is no precedence in this case. For MVC and Web API it was possible to body bind an action parameter which used an empty prefix instead of a parameter name for adding errors to model state (In case of MVC if a custom prefix was provided, it failed binding from body i.e the parameter was null).
2015-04-22 14:02:08 -07:00
Kevin Dockx f1e1d8f4df Initial Json Patch check-in 2015-03-23 14:46:49 -07:00
Ryan Nowak fc00aff7c5 Add TestCommon project 2015-03-16 13:49:29 -07:00
N. Taylor Mullen c1a026cbf7 Update .kproj => .xproj. 2015-03-11 14:01:43 -07:00
N. Taylor Mullen df4b92b1c1 Update MVC projects to utilize Common repo classes.
- Had to add extra dependencies to work around aspnet/XRE#1237.
- Updated src and test projects.
2015-02-22 18:23:28 -08:00
Yishai Galatzer bb31e2aec5 Rename Microsoft.AspNet.PageExecutionInstrumentation to Microsoft.AspNet.PageExecutionInstrumentation.Interfaces 2015-02-19 12:02:29 -08:00
Pranav K 5ed0638402 Move PageExecutionListener interfaces to a separate assembly. 2015-02-11 18:06:20 -08:00
damianedwards 3d33418f31 Add the LinkTagHelper:
- #1580
2015-02-03 10:12:38 -08:00
Anthony Sneed 1118315a9d [Resolves #1887] XmlDataContractSerializer Input and Output Formatter Tests Cleanup. 2015-01-30 10:02:33 +01:00
Pranav K a452205e60 Moving Microsoft.AspNet.Mvc.Xml to src dir 2015-01-29 10:28:40 -08:00
Pranav K fde1b13b4a Updating Mvc.NoFun.sln 2015-01-29 10:26:38 -08:00
damianedwards 759fbbd661 Added the EnvironmentTagHelper:
- #1553
2015-01-22 10:17:25 -08:00
Chris Ross 91d7e382d1 Consume new strongly typed headers. Remove temp implementations. 2015-01-14 15:51:34 -08:00
Pranav K f649fb45c8 Adding TestConfiguration to NoFun.sln to avoid it from modifying the sln
on open
2015-01-05 13:42:41 -08:00
Ryan Nowak f66345263d Add WebApiCompatShim project structure 2014-10-10 13:41:35 -07:00
NTaylorMullen be4a6c8d98 Split FunctionalTests from Mvc solution.
- Created a solution that had everything the Mvc.sln had EXCEPT functional tests.
- Added Mvc.NoFun.sln.

#1227
2014-10-09 12:18:30 -07:00