Commit Graph

324 Commits

Author SHA1 Message Date
David Fowler c4f01b8ec9 Removed MVC's custom request scope
We need to figure out a consistent way to throw errors when there isn't
a request scope already setup.
2014-04-17 20:10:18 -07:00
David Fowler b3d851dfe9 Added [NotNull] 2014-04-17 20:01:49 -07:00
David Fowler fba1b400fe Removed comment 2014-04-17 20:00:06 -07:00
David Fowler 73e1386724 Added UseMvc extension method via IBuilder extensions. 2014-04-17 19:55:23 -07:00
dougbu b8eb16d98d Fix #266: Throw when views aren't found at call sites
- note `htmlHelper.Display()` does not throw on failures
2014-04-17 12:05:16 -07:00
Louis DeJardin f19fe0cbef Filters version 2.0
This is functionally much more similar to legacy MVC.

Rather than a pure single pipeline, filter execution takes place in more
stages.
2014-04-17 11:45:58 -07:00
David Fowler 93c9b3419e Made some changes to the MvcApplication class
- 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.
2014-04-17 00:02:10 -07:00
David Fowler 44ee632825 Added overload that takes IConfiguration 2014-04-16 23:59:37 -07:00
David Fowler 4fc0b56dfa Added extension method to ServiceCollection to register default services 2014-04-16 23:59:36 -07:00
Ryan Nowak ce1f813a82 More spot fixes for warnings as errors 2014-04-16 20:21:10 -07:00
Ryan Nowak 40e7fcc9ba Turning on warnings as errors 2014-04-16 20:21:07 -07:00
Ryan Nowak 5075679936 Cleaning up more warnings
These are the cases where an interface returns Task, but our
implementation is synchronous. In these cases we prefer to declare the
method as async and suppress, because this keeps the exception semantics
the same as a 'true' async method.
2014-04-16 20:09:01 -07:00
Ryan Nowak c54f6d006b Fix for #57
Removing last use of ActivatorUtilities
2014-04-16 18:36:44 -07:00
Ryan Nowak b8bd6a5886 Fixing a warning
The constant ValidationType was hiding a property on the base class.
2014-04-16 16:50:31 -07:00
harshgMSFT 72732868c6 Adding DisplayName, Label HtmlHelpers. 2014-04-16 11:41:47 -07:00
Pranav K b9b652084a Introducing IClientModelValidator to support client validation
* Adding support for validator adapters in DataAnnotationsModelValidatorProvider
* Adding Regex and DataType validators
2014-04-16 06:27:52 -07:00
Ryan Nowak f34ed467e4 Fix for #246 - ActionLink generating wrong urls
There's an overload that's missing from ActionLink but is present on url
helper, making it very easy to mistakenly pass the wrong data. In the case
of #246, the controller name is treated as the route-values and the
route-values treated as html attributes, leading to the wrong link being
generated.
2014-04-15 15:23:59 -07:00
harshgMSFT 5810215306 Updating the Kproj file to contain the missing reference to NonActionAttribute.cs 2014-04-15 15:14:32 -07:00
sornaks 646b711b11 Adding the missed project files for WebFX:156 - Introducing RedirectToAction and RedirectToRoute 2014-04-15 13:49:57 -07:00
Sornakumar ecd8ddeae4 WebFX 156: Adding support for RedirectToAction and RedirectToRoute 2014-04-15 10:45:57 -07:00
harshgMSFT 1536daa107 Adding NonAction Attribute 2014-04-14 16:18:16 -07:00
dougbu 246bb2e3dd Add `DropDownList()` and `DropDownListFor()` HTML helpers
- 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
2014-04-14 16:05:07 -07:00
dougbu 271c849923 Fix #231; add `ViewBag` to `ViewComponent`
- update MVC sample to demonstrate use and that `ViewBag` is scoped
- nit: add a bit of padding between border and tag cloud words
2014-04-12 14:10:16 -07:00
dougbu 0e7dff9ca7 Get CoreCLR test builds compiling again
- no Mock without .NET 4.5
- reverts part of "Reviving support for IValidatableObject in CoreCLR"
- that was commit 0f6df5405b.
2014-04-12 13:45:11 -07:00
Pranav K 0f6df5405b Reviving support for IValidatableObject in CoreCLR 2014-04-10 22:09:57 -07:00
dougbu 0d9c052e43 Restore ability to run some tests using CoreCLR
- revert part of "Made a few more changes since we have new tooling"
- was commit b1fd5cc689
2014-04-10 17:15:17 -07:00
dougbu ba08f8e8d8 Cleanup Display, Partial, and Validation extensions
- 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
2014-04-10 17:12:16 -07:00
Ryan Nowak d2453c5832 Bringing back Razor.Host as an assembly as a TEMPORARY WORKAROUND
The tooling team needs this as separate assembly. This will be removed
again soon.
2014-04-10 15:54:47 -07:00
Wei Wang 86d327366f Fix wrong order of arguments passed to ArgumentException ctor 2014-04-10 13:56:50 -07:00
dougbu d7110017fd Sample should be built in VS
- catches errors because some methods are used only from views or controllers
2014-04-10 11:52:58 -07:00
Ryan Nowak 408d4056b1 Rearrange ViewContext 2014-04-10 11:40:57 -07:00
Ryan Nowak cda73e95a8 Integrate dictionary helper with existing code paths 2014-04-10 11:21:35 -07:00
dougbu f0c6512b61 Catch up with previous `ActionNameAttribute` addition 2014-04-10 09:27:45 -07:00
harshgMSFT 53b76380eb Adding ActionName Attribute 2014-04-09 15:48:30 -07:00
dougbu 1da2d6d9dc Checkin VS auto-update to .kproj file 2014-04-09 14:31:33 -07:00
dougbu 82b071c80e Add CR-requested comment 2014-04-09 14:30:12 -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
David Fowler b1fd5cc689 Made a few more changes since we have new tooling
- Remove runtime interface declarations and use
  Microsoft.Net.Runtime.Interfaces package
- Made tests compile for net45 and made default
  intellisense view net45 for unit tests since Moq
  doesn't work
2014-04-09 12:24:16 -07:00
David Fowler a970fa04ab Updated to use the new tooling 2014-04-09 12:24:16 -07:00
Ryan Nowak 35bfa84274 CR feedback 2014-04-09 11:10:05 -07:00
Ryan Nowak 4e1511ed4d Adding ActionLink 2014-04-09 11:07:15 -07:00
Pranav K c8ede78582 Expanding ValueProviderResult to support more data types
* Reviving tests for ValueProviderResult
2014-04-09 09:33:29 -07:00
Pranav K ea3e958563 Adding unit tests for CompositeModelBinder 2014-04-08 18:48:01 -07:00
Ryan Nowak 527394c492 CR feedback 2014-04-08 16:05:51 -07:00
Ryan Nowak e740633c06 CR feedback 2014-04-08 16:05:49 -07:00
Ryan Nowak ab605ef935 Fix for #215 - nullref trying to generate link in a partial
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
2014-04-08 16:05:48 -07:00
Ryan Nowak 749789c486 CR feedback 2014-04-08 15:57:40 -07:00
Ryan Nowak 084c7f80e5 Further rearranging IView/IViewEngine/ViewContext et al 2014-04-08 15:57:39 -07:00
dougbu 4feb8f4f28 Remove reduncant `ArgumentNullOrEmpty` resource from Core project
- came from Rendering but Core already had `ArgumentCannotBeNullOrEmpty`
- moved wording from "argument must not be" to "value cannot be"

Also make similar resources consistent in this repo
- adjust Razor's `ArgumentCannotBeNullOrEmpty` resource to use same wording
  as Core, adding "The"
- update ModelBinding to also have `ArgumentCannotBeNullOrEmpty` and to use
  it consistently with Core and Razor
2014-04-08 12:03:50 -07:00
Sornakumar b25091f6c1 Merge branch 'WebFX156' into dev 2014-04-08 10:52:38 -07:00