Commit Graph

13 Commits

Author SHA1 Message Date
Ryan Nowak 08a578d01f Issue #1525 - Enhancements to ActionContext
- Adding a new constructor that takes ModelState.
 - Removing an extra constructor that's not needed
 - docs
 - test cleanup
2015-01-27 14:35:31 -08:00
Chris Ross 9aff289dfe Handle PipelineCore rename. 2015-01-15 15:25:17 -08:00
Doug Bunting 6df288bce7 Correct StyleCop violations
- StyleCop working again (handles C# 6.0 additions) though only locally for me
- disable some new rules:
 - ConstFieldNamesMustBeginWithUpperCaseLetter
 - InstanceReadonlyElementsMustAppearBeforeInstanceNonReadonlyElements
 - StaticReadonlyElementsMustAppearBeforeStaticNonReadonlyElements
 - StaticReadonlyFieldsMustBeginWithUpperCaseLetter
 - PrefixCallsCorrectly
- correct remaining violations
 - lots of long lines for example
 - use more `var`; some manual updates since StyleCop doesn't check seemingly-unused blocks

nit: remove new trailing whitespace (was paranoid about adding it w/ fixes)
2015-01-06 16:23:57 -08:00
ianhong 5b1eae494e Update templates\samples\tests to use ensure viewstart.cshtml and views directory names are cased appropriately. #1559 2014-12-05 13:27:22 -08:00
Victor Hurdugaci dbdf2e66ba Update message from DI exception 2014-12-03 13:09:44 -08:00
Victor Hurdugaci 91549e15a5 React to DI changes 2014-12-03 12:09:31 -08:00
Ryan Nowak 8ce069f56a [Fixes #393] [Design] Update ViewComponent result apis to be consistent with Controller
1. Updated ViewComponent to exposes similar properties to the existing ones in controller where
appropiate. We've left out Resolver for being a bad pattern (just inject the dependency on the constructor
or use Context.RequestServices to access it if needed) and Response as although available through the Context
property, it shouldn't be used/modified in a ViewComponent.

2. Updated ViewViewComponentResult to follow a similar pattern as ViewResult where the constructor is
parameterless and elements like ViewEngine are resolved during execution if the user does not set the
associated property on the object.

3. Updated ExecuteAsync in JsonViewComponentResult to remove the unnecessary pragma and async keyword from the
signature and to use Task.FromResult(true) instead.

4. Cleaned up ViewViewComponentResult tests.
2014-11-26 15:56:06 -08:00
Doug Bunting 5e067cdb9e Delete trailing whitespace
- #EngineeringDay
- Total replaced: 660  Matching files: 270 in *.cs
- Total replaced: 250  Matching files: 32 in all other files
- Total replaced: 22  Matching files: 8 in a few stragglers

Did not change files under following directories
- test\Microsoft.AspNet.Mvc.Razor.Host.Test\TestFiles\Output
- test\Microsoft.AspNet.Mvc.FunctionalTests\compiler\resources
- test\WebSites\TagHelpersWebSite
(Razor generates trailing whitespace in a case or two)
2014-11-20 16:18:09 -08:00
Ryan Nowak 83187945d1 Fix for #1052 - ViewComponents should support fully qualified names
This change adds the concept of a full-name to viewcomponents. View
components can be invoked using either the short name or long name. If the
provided string contains a '.' character, then it will be compared against
full names, otherwise it will be matched against short names only.

The short name is used for view lookups.

If the name is explicitly set via ViewComponent attribute, then the full
name is the name provided. The short name is the portion of the name after
the last '.'. If there are no dots, then the short name and full name are
the same.

If the name is not set explicitly, then it is inferred from the Type and
namespace name. The short name is the Type name, minus the 'ViewComponent'
suffix (if present). The full name is the namespace of the defining class,
plus the short name.
2014-10-29 17:34:01 -07:00
Ryan Nowak 9a77c2bc1e Fix for #1448 - ViewComponents must be public top-level classes
ViewComponents and Controllers now follow the same rules exactly for what
types of classes they can be.

Also corrected a bug in a test for controllers. Closed-generic types can
be controllers, the test was wrong.
2014-10-28 12:36:07 -07:00
Pranav K 78bda87730 Replacing ViewResultBase with ViewExecutor 2014-10-22 08:47:22 -07:00
Pranav K 5119d16b64 ViewComponent.Invoke() should be able to invoke views
Fixes #285
2014-10-17 12:23:18 -07:00
Pranav K 26f98b481a ViewComponents should render partial views
Fixes #960
2014-08-14 11:14:05 -07:00