Commit Graph

196 Commits

Author SHA1 Message Date
dougbu 32d031c6eb Add `ModelMetadata` to `ViewData`
- demonstrate `ModelMetadata` is available in a view

Also
- simplify `View()` overloads in `Controller`, pending #110 decisions
- make `Model` in `RazorView<T>` readonly
2014-03-21 14:42:42 -07:00
Pranav K 857a239990 Making Moq version in Mvc.Core.Test consistent with all other test projects 2014-03-21 14:11:49 -07:00
harshgMSFT f20b798a07 Modifying the Default Action convention to have verb only methods 2014-03-21 12:34:42 -07:00
Pranav K f1c4a8e497 Change FormValueProviderFactory to use GetContentType for media type matching
Fixes #68
2014-03-21 12:10:12 -07:00
Ryan Nowak 1ca2203421 cr feedback 2014-03-21 11:13:15 -07:00
Ryan Nowak 6610788b75 Restore the TextWriter to ViewContext 2014-03-21 11:13:14 -07:00
Pranav K 8ea196023e Modify controller discovery to only look for types that reference Mvc.Core
assembly
2014-03-21 10:02:54 -07:00
Pranav K 683c5bf9b3 Adding JsonInputFormatter for reading json encoded data from the request
body
2014-03-20 20:48:25 -07:00
dougbu 4364986137 System.Text.Encoding has rev'd 2014-03-20 14:38:54 -07:00
Ryan Nowak c4a15f021f Passing additional data on the ViewContext for resolving views.
This will be necessary for partials, and for Components.

Basically, the view engine uses a dictionary of data to find the top level
view (for an action) - after we do that, we want this context to be
sticky, which means we need to pass it around. This ensures that partials
and components will be resolved under the same paths as the main view.

Currently this 'data' is just the route values - and there is an ongoing
discussing about the right design here. The data that's being passed WILL
change in the future.
2014-03-20 12:18:02 -07:00
Yishai Galatzer 8b6d39507d Feedback: Make common base class for all contexts and all of them expose FilterItem collection
ExtensionMethod will now apply to the base FilterContext class
2014-03-20 09:59:24 -07:00
Yishai Galatzer adffc95b81 AllowAnonymous attribute + Consumption + Sample 2014-03-20 09:59:24 -07:00
dougbu 5875452755 Quick fix-ups
- Move .NET test projects back into net45 folder
- Catch up with latest System.Runtime.InteropServices version
2014-03-19 23:41:17 -07:00
Yishai Galatzer dcc286a299 Refactor FindView to always take a viewName (no null support)
and only use RouteValues (or generically just Dictionary<string, object>).

This is temporary and will change once we get Partials (which are currently just dead code)

For now this will unblock ViewComponents
2014-03-19 18:48:36 -07:00
Pranav K f8dd52dfe3 Reintroducing BindingBehaviorAttribute attribute
* Porting MutableObjectModelBinder tests
* Fix issues in MutableObjectModelBinder introduced by changing from
  TypeDescriptors to reflection
2014-03-19 16:52:02 -07:00
harshgMSFT 9cd99a42a7 ActionExecutor implementation WebFx W113
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
2014-03-19 11:10:42 -07:00
dougbu 4bc7c36522 Merge two `TypeExtensions` classes into Common\TypeExtensions.cs
- add missing `[NotNull]` attributes
- remove now-unneeded usings for ...ModelBinding.Internal namespace

Also get ModelBinding test project working under CoreCLR
- create separate k10 and net45 folders under test in VS
- add `[InternalsVisibleTo]` to make `TypeExtensions` visible to test assembly
- correct tests' `CultureInfo` use to compile under CoreCLR
- ifdef out CoreCLR tests depending on Moq, ReadOnly, ...
- remove a couple of tests expecting TypeConverter to work
2014-03-19 09:53:40 -07:00
Yishai Galatzer 227121b3f9 CR Feedback 2014-03-19 09:26:20 -07:00
Yishai Galatzer 7d9a6297f9 Fix debug string 2014-03-19 09:26:19 -07:00
Yishai Galatzer cfb06c0de3 Areas feature - Phase I
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
2014-03-19 09:26:18 -07:00
Pranav K 072e2cc1f1 Updating DataAnnotations version in project.json 2014-03-18 20:56:08 -07:00
Pranav K eae9d3a951 Update GenericModelBinder.BindModel to use correct overload of
Activator.CreateInstance
2014-03-18 16:34:18 -07:00
dougbu 3a0add8be8 Cleanup pass: Move Rendering classes to correct namespace
- 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
2014-03-18 14:02:39 -07:00
dougbu 478c220ddb Revert "Merge two `TypeExtensions` classes into Common\TypeExtensions.cs"
This reverts commit d534471515.
2014-03-17 22:53:36 -07:00
dougbu f714425619 Revert "Address CR comments"
This reverts commit d815329f71.
2014-03-17 22:52:39 -07:00
dougbu d815329f71 Address CR comments
- reduce #if use
- remove outdated comment
2014-03-17 22:49:30 -07:00
dougbu d534471515 Merge two `TypeExtensions` classes into Common\TypeExtensions.cs
- add missing `[NotNull]` attributes
- remove now-unneeded usings for ...ModelBinding.Internal namespace
- remove TypeExtensionTests.cs; don't add .NET 4.5-only
  `[InternalsVisibleTo]` for low-level `IsCompatibleWith()` extension
2014-03-17 21:02:25 -07:00
David Fowler a8cc6828dd Nuke the old MvcSample self host sample 2014-03-17 19:00:12 -07:00
dougbu ed1b2ddcc3 Run unit tests during builds
- add "test" command
- use latest (forked) XUnit packages
  update package references
  [PropertyData] -> [MemberData]
  Xunit.Extensions -> Xunit or Xunit.SDK
  Moq now available for .NET 4.5 only
- delete a couple of unit tests checking for ArgumentNullException
- provide TestCommon classes in Razor and Razor.Host test projects
- make ReplaceCulture internal because it's a shared source
2014-03-17 16:28:25 -07:00
N. Taylor Mullen f8179f03e4 Trigger view rendering asynchronously.
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.
2014-03-17 12:18:54 -07:00
David Fowler 0247c3a393 Updated RoslynCompilationService to account for new changes to API 2014-03-16 23:42:50 -07:00
Ryan Nowak 1a430f90ed porting to web sample 2014-03-14 13:06:27 -07:00
Ryan Nowak 51e5a5bf19 Fix for issue #57
Replaced ActivatorUtilties with ITypeActivator in WebFX.
2014-03-14 12:51:20 -07:00
Ryan Nowak a5cb050b97 Using AutoFac to register open generic service types 2014-03-14 12:46:17 -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
Pranav K 90e6897247 Fixing build 2014-03-14 10:22:37 -07:00
Pranav K d86298ffe1 Switching over placeholder attributes to use DataAnnotation attributes 2014-03-14 09:48:40 -07:00
Yishai Galatzer 3461c44a5e Move filteritem out to it's own class 2014-03-13 18:29:54 -07:00
Yishai Galatzer 5849ba8544 Cleanup after refactoring 2014-03-13 18:15:24 -07:00
Yishai Galatzer c4481cf390 One more refactoring 2014-03-13 17:26:21 -07:00
Yishai Galatzer fc168d63f6 refactor to return ordered filter list from filter provider
Arrange filters to a pipeline in the action invoker
Allow providing the original filter definition to a type and service filter
2014-03-13 17:26:21 -07:00
Pranav K d9867b4831 Changing IModelValidatorProvider DI to be transient for now 2014-03-13 12:04:45 -07:00
Pranav K e434918337 Reintroduce model validation 2014-03-12 21:55:50 -07:00
Stephen Halter cca3f92c5f Temporarily migrate the MvcSample project to Autofac 2014-03-12 15:17:41 -07:00
Ryan Nowak 00f15669dc More CR feedback on URL generation 2014-03-12 11:12:52 -07:00
Ryan Nowak 77a7bb58a6 CR feedback 2014-03-12 10:57:48 -07:00
Ryan Nowak 12985c19ee CR feedback 2014-03-12 10:57:47 -07:00
Ryan Nowak 0ce2c511d4 Adding URL generation to WebFX for controllers and views
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.
2014-03-12 10:57:46 -07:00
Yishai Galatzer 9af7c2bbfb remove usings, fix spacing 2014-03-11 13:49:26 -07:00
Ryan Nowak 5867a6a5fc CR feedback that didnt get merged 2014-03-11 13:06:01 -07:00