- Updated project.json to have a valid webroot. Webroot isn't pointing to the specific folder because the TagHelperSample has no valid content for the webroot yet.
1) Expose the simplified relative path template by cleaning up constraints, optional and catch all tokens from the template.
2) Expose the parameters on the route template as API parameters.
3) Combine parameters from the route and the action descriptor when the parameter doesn't come from the body. #886 will refine this.
4) Expose optionality and constraints for path parameters. Open question: Should we explicitly expose IsCatchAll?
IActionConstraint follows a provider model similar to filters. The
attributes that go on actions/controllers can be simple metadata markers,
the 'real' constraint is provided by a set of configurable providers. In
general the simplest thing to do is to be both an
IActionConstraintMetadata and IActionConstraint, and then the default
provider will take care of you.
IActionConstraint now has stages based on the Order property. Each group
of constraints with the same Order will run together on the set of
actions. This process is repeated for each value of Order until we run out
of actions or run out of constraints.
The IActionConstraint interface is beefier than the equivalent in legacy
MVC. This is to support cooperative coding between sets of constraints
that know about each other. See the changes in the sample, which implement
webapi-style overloading.
1) Implemented FilePathResult to efficiently return files from disk.
2) Implemented FileStreamResult to return content from a stream.
3) Implemented FileContentResult to return content from a byte array.
This adds support for attributes which interact with reflected model.
These conventions are applied after all of our built-in constructs so that
you can see and modify the results.
1. Added an Order property to IRouteTemplateProvider, ReflectedAttributeRouteModel,
AttributeRouteInfo, AttributeRouteLinkGenerationEntry and AttributeRouteMatchingEntry.
2. Changed the implementation of AttributeRoute to take the order into account when routing
incomming requests and generating links.
3. Ensured a stable ordering of route entries with the same order and precedence for route
matching and link generation based on the template text.
4. Added tests to validate that the precedence gets respected in route matching and link generation.
5. Added tests to validate that the order gets respected in route matching and link generation.
6. Added tests to validate that the order gets respected over the precedence for route matching
and link generation.
7. Added tests to validate that routes with the same order and precedence expose a stable ordering
for route matching and link generation.
- #874 lines 3, 4, and 6
- correct `Value()` to treat a `null` expression name the same as `string.Empty`
- add missing `[NotNull]` attributes in `EditorExtensions` and for `GenerateIdFromName()`
- consistently pass `null` for default expression names to the helpers
- for example, from extension methods
- add test cases using `null` for expression name
nits:
- correct summary XML comment for `HtmlHelper` class
- use named parameters and prefer interface (not extension) methods in changed calls
- use `string.Empty` instead of `""` in a few tests
1. Added HttpNotFound() to Controller.
2. Updated HttpStatusCodeResult to expose the StatusCode as a property.
3. Added unit tests for HttpNotFound() and for HttpStatusCodeResult.
4. Updated the MvcSample to add an action that uses HttpNotFound().
5. Brought back HttpNotFoundResult and added unit tests for it.
This change enables user to specify the tag for the wrapping HTML element
generated from ValidationSummary() and ValidationMessage[For]().
Clean up HtmlHelperValidationExtensions.
- 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
- copy over legacy `Editor*()` extensions and default editor templates
- get working in the new world
- usual `var`, `String` -> `string`, `internal` -> `public`, namespaces, ...
- longest overloads into `IHtmlHelper[<TModel>]` and implementation classes
- clean up `ViewContext.ViewData` -> `ViewData`, trailing whitespace, long lines
- remove `MultilineTextTemplate()` since `TextArea()` doesn't exist yet
- remove `ColorInputTemplate()` since `Color` type doesn't exist
- use `html.Label()`, not `LabelExtensions.LabelHelper()`: equivalent helper
is protected. only downside is potential `ModelMetadata` re-discovery.
- rename `HtmlInputTemplateHelper()` -> `GenerateTextBox()`
- copy over `Html5DateRenderingMode` and `html.Html5DateRenderingMode` property
- and get them working in new world
- hook the default editor templates up
- use `Editor()`, `EditorFor()`, `EditorForModel()` in MVC sample
- add an on-disk editor template to MVC sample
- first get old code in correct spot
- then get default templates working in new world
- usual things: `[NotNull]`, `var`, internal -> public
- provide a `HtmlHelper.GenerateOption()` static method
- pass an `ViewDataDictionary<object>` instance to `TemplateRenderer` constructor
- run default templates synchronously with an IHtmlHelper<object>
- copy over resources
- add Microsoft.Data.Entity reference for EntityState type
- use default templates in MVC sample
- remove most on-disk overrides of the default templates
- Renamed it to MvcRouteHandler
- Removed required IServiceProvider ctor param.
- The HttpContext flows the application services through to MVC. This does
require a call to app.UseContainer in order for things to work but that should be fine.
This will be the pattern we use for all frameworks going forward and we'll need to have some
good error handling around this area when things aren't wired up properly.
- copy over legacy MVC's `SelectExtensions`, `SelectListItem` and `SelectListGroup`
- plus expected `SelectList` and `MultiSelectList`
- fixup select HTML helpers to meet WebFx standards and work in new world
- usual stuff: `[NotNull]`, `var`, `String` -> `string`, long lines, ...
- remove `IDictionary<string, object> htmlAttributes` overloads
- move longest extension method overloads into correct classes / interfaces
- add `ViewDataEvaluator.Eval()` overload for an `object` container
- rename lower-level helpers to make purposes more obvious
- nit: move Raw() methods up from bottom of HtmlHelper.cs
- use `DropDownList[For]()` in MVC sample
- correct file and class names for some HH extensions
- three class names were correct but didn't match containing file
- three class and file names matched but didn't start with HtmlHelper
- clean up trailing whitespace and long lines in changed Extensions.cs files
- `HtmlHelperPartialAsyncExtensions`, `HtmlHelperRenderPartialAsyncExtensions`
and `HtmlHelperValidationExtensions` lacked some `[NotNull]` attributes
- merge extension files by concept
- Display / DisplayFor / DisplayForModel methods all into `HtmlHelperDisplayExtensions`
- Partial / RenderPartial methods all into `HtmlHelperPartialExtensions`
- use `IHtmlHelper<TModel>` everywhere
- 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 😺
The fix here is to do some cleanup we've been planning to do for a while,
rather than flowing IUrlHelper and IComponentHelper as part of the
ViewContext, they now are just grabbed from the service provider.
This simplifies the code for invoking a view, and gets us closer to the
desired API surface of ViewContext
- copy over from legacy MVC
- fixup namespaces, remove copyright notices, ...
- temporarily remove `RouteBeginForm() overloads
- move main components to `HtmlHelper` and declare in `IHtmlHelper<T>`
- change `UrlHelper` to avoid treating an existing dictionary as an object
- add `HtmlHelper.Createform()` factory
- use in MVC sample; move BeginForm / TextBox samples to a new row
Showcased a lot of the core pieces of DisplayFor 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.
Showcased a lot of the core pieces of DisplayFor 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.
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.
Initial draft for DefineSection \ RenderSection. This change is based on
changes to the Razor parser to enable Razor to generate HelperResults for
section instead of void delegates.
- HtmlHelper service now needs an `IModelMetadataProvider` instance
- make `GetInputTypeString()` private
- use `TextBox()` and `TextBoxFor()` in MVC sample
- throw if `ExpressionMetadataProvider.FromLambdaExpression()` returns `null`
- `Name()` is a `virtual` instance method to allow useful derivation
- `NameFor()` is an instance method to avoid adding `GetExpressionName()`
to the public surface; either method could be `virtual`
- `NameForModel()` is an extension method because it's not usefully overridden
- use `Name*()` in sample
We'll create a scoped service provider if the middleware that does it
isn't there.
We resolve all of our stuff from the scoped service provider, allowing
users to plug in any scoped things they want.
Ported UrlHelper to be a scoped service.
- move `DynamicObject` derivation up to new `DynamicViewData` class, fixing [WebFx-169](http://projectk-tc:8080/browse/WEBFX-169)
- avoid direct `_data` lookup in previous `TryGetMember()`, fixing [#118](https://github.com/aspnet/WebFx/issues/118)
- rename ViewData -> ViewDataDictionary
Also
- flesh out `IDictionary<string, object>` implementation in `ViewData`
- provide `ViewData` copy constructor that allows TModel to change
- remove `TryGetIndex()` and `TrySetIndex()` implementations; use `ViewData[]` instead
- restore `ViewContext.ViewBag` from legacy MVC
Modified ModelState to only ever be created on the ActionContext and then plumbed/exposed it on ViewData and Controller. This will enable: ActionFilterContext's will have access to ModelState via its ActionContext member, allow HTMLHelpers to access ModelState via ViewData, and unify the locations of "source" model state. In the old world we used to copy/replace/instantiate new model state all over unnecessarily.
- demonstrate `ModelMetadata` is available in a view
Also
- simplify `View()` overloads in `Controller`, pending #110 decisions
- make `Model` in `RazorView<T>` readonly
The changes include:
1. Action executor changes required for supporting sync and async operations Taksk and Task
2. Adding test project for MVC core - This contains ActionExecutor Tests.
3. Also adding a resources file for MVC core project
1. Areas defined by the Area attribute
2. Areas are a routeconstraint on the actiondescriptor
3. Areas find pages through route values
Other changes:
1. Remove Path from ActionDescriptor - It doesn't make sense with this change
2. Add sample Area
- use Microsoft.AspNet.Mvc.Rendering namespace throughout assembly
Also
- move `IdAttributeDotReplacement` from `TagBuilder` to `HtmlHelper`
- remove commented-out code in `HtmlHelper`
- use `var` and `[NotNull]` more
- `String` -> `string`
- correct Resources references; add missing resources
This is as simple as modifying the base class to return task and await the ExecuteAsync method. Also added a piece to the sample project to verify functionality.
This follows a similar pattern to html helpers - a minimal basis interface
that performs the main functionality, and a set of extension methods that
make up the rich API.
- Now that services are being flowed through the entire stack
we can nuke the csc service and always use the roslyn based compilation for views
- The RoslynCompilationService is still very much a prototype but it's a good
step to see what other services might may or may not need to flow.
- Removed the PhysicalFileSystem construction from Mvc itself. This will come from
the hosting layer and is newed up temporarily in the PathBasedViewFactory itself.
* Modify ReflectedActionInvoker to model bind parameters
* Introduce IBodyReader for reading request bodies
* Introduce types for per-action-context specific binders, value providers
and body readers
- Flow the host service provider to MvcServices
- Use assembly neutral interfaces to access host services
- Added RoslynCompilationService to Microsoft.AspNet.Mvc.Razor
- Modified self host sample as helios needs to be updated to flow more services
Renamed actiondescriptor to routecontext, because action selection didn't happen yet.
Need to add actiondescriptors back and modify RazorViewEngine to use the right thing.
Scan only relevant (non skipped) assemblies
FinalizeSetup point, to make "stuff" immutable
Support controllers under any namespace
support customizing controller discovery
support customizing skipped assemblies
support customizing multiple controllers with the same name under different namespaces and assemblies
support controller ambiguity detection
* Paths rooted by a leading slash (e.g. /foo) are correctly resolved by the
PhysicalFileSystem. This change is an experiment to determine if we can
get away with not having virtual paths in WebFx.
* Additionally removing types (MetadataVirtualPathViewFactory,
VirtualPathAttribute) that are currently unused.