Commit Graph

40929 Commits

Author SHA1 Message Date
Pranav K 75dae948b2 Change IViewEngine.FindView to be synchronous 2014-04-03 14:20:39 -07:00
Pranav K 2e0bed750e Adding support for Url.Content, Href and ~/ in Razor views 2014-04-03 14:12:55 -07:00
Pranav K f4904e1803 Fixing PathString.Add(PathString) to handle trailing slashes correctly
Fixes #31
2014-04-03 12:55:45 -07:00
Ryan Nowak 49de9d2828 Adding Value Html Helpers 2014-04-03 12:22:03 -07:00
Chris Ross d83d2e98d6 Review cleanup, fallback logger, CreateDataProtecter extension. 2014-04-03 10:43:11 -07:00
dougbu 42561f14d3 Quick fix for a build warning
- remove a duplicate using of `System.Collections.Generic`
- FYI `k build` command does not detect this problem
- nit: also cleanup long lines and align wrapped parameters
2014-04-03 09:38:14 -07:00
Yishai Galatzer ebd54bfc06 Dispose controllers after they have been utilized by the action invoker 2014-04-03 09:31:23 -07:00
dougbu 0a62a581de Add `TextBox` and `TextBoxFor`
- HtmlHelper service now needs an `IModelMetadataProvider` instance
- make `GetInputTypeString()` private
- use `TextBox()` and `TextBoxFor()` in MVC sample
- throw if `ExpressionMetadataProvider.FromLambdaExpression()` returns `null`
2014-04-02 20:49:48 -07:00
dougbu a1a180d4d0 Fill out Rendering.Expressions II
Copy from:
- some `static` `ModelMetadata` methods -> `ExpressionMetadataProvider`
- `TryGetValueDelegate` -> `TryGetValueDelegate`
- `TypeHelpers.CreateTryGetValueDelegate()`, related bits -> `TryGetValueProvider`
- `ViewDataDictionary.ViewDataEvaluator` inner class -> `ViewDataEvaluator`
- `ViewDataInfo` -> `ViewDataInfo`
- `ViewDataDictionary.Eval()`, related bits -> add to `ViewDataDictionary`

Change to fit in new world:
- usual stuff: `var`, `[NotNull]`, String -> string, namespaces, etc.
- PropertyDescriptor -> PropertyInfo
- update Reflection use
- no `IModelMetadata.Container` property
- improve a couple of variable and parameter names
- make `ViewDataInfo` immutable
- make `ViewDataDictionary.FormatValueInternal` `public` and -> `FormatValue`
- remove `[SuppressMessage]` attributes
2014-04-02 20:02:36 -07:00
Ryan Nowak 87c2041a52 Removing a dangling project from the sln 2014-04-02 19:32:30 -07:00
Ryan Nowak 798145418f Add a verify call to a test 2014-04-02 18:58:39 -07:00
Yishai Galatzer d081300185 Factor filters action to private methods 2014-04-02 18:51:50 -07:00
Yishai Galatzer 9756f74565 Action invocation changes:
Changed 404s to throw
Propagate reflected exception
Add resources for specific errors
2014-04-02 18:51:49 -07:00
Praburaj 4709bca281 A few changes with this checkin:
1. Removing copyright text from all files per a code review feedback
2. Adding a cookie based session to the application to retrieve the cart Id.
3. Enabled the Accounts controller as we now have the necessary Http abstractions for User, SignIn, SignOut etc.
4. Changing self hosting scripts to run on coreclr by default.
5. Enabling the layout page on all required views.
6. Adding a favico.ico
7. Renaming the Cart property in the EF context to CartItems as it returns a CartItems list.
8. Uncommenting some code which was previously accessing unavailable APIs. They are available now (but yet to validate them).
2014-04-02 18:40:25 -07:00
Ryan Nowak 1b4754454b Relayering MVC Dependencies Part 1/N
Merging Mvc.Razor.Host into Mvc.Razor
2014-04-02 18:28:34 -07:00
sornaks 9f3433acec WebFX 156 - Introducing RedirectPermanent.
Merging RedirectPermanent to Redirect.
2014-04-02 15:24:20 -07:00
dougbu 7a97b13c8c Cleanup pass in Rendering (and Common)
- correct `ArgumentNullOrEmpty` and pass parameter name to
  `ArgumentException` constructor
- remove `[SuppressMessage]` attributes
- `AnonymousObjectToHtmlAttributes` should return an `IDictionary`
- `var`
- remove straggling copyright notices
- wrap long lines (did not reword any comments)
- align a few parameters
2014-04-02 14:59:35 -07:00
N. Taylor Mullen dad87c5239 Add ValidationSummary helper.
This enables Html.ValidationSummary.  This is in reference to WEBFX-97.
2014-04-02 14:58:08 -07:00
Hao Kung 8549d83b7c Identity.Security not enough to prevent infection
- Viral cancellationToken API infection everywhere
- Add Identity.Security SignInManager which depends on Abstractions
2014-04-02 12:25:52 -07:00
Pranav K 9c4a6e901d Modifying DefineSection to generate HelperResult types 2014-04-01 18:32:37 -07:00
Chris Ross 2b226c936f Update for latest abstraction contracts. 2014-04-01 17:18:37 -07:00
Chris Ross ee37c75544 Rename Auth Context API Ack to Accept 2014-04-01 17:08:09 -07:00
Chris Ross dfc0c5d323 Change GetAuthType to use a context object instead of a delegate. 2014-04-01 16:29:47 -07:00
Chris Ross c638c74bc9 Move AuthManager methods to Context and Response. 2014-04-01 16:03:54 -07:00
Yishai Galatzer b9010072aa Fix github #164 (when return type is object we always return 204) 2014-03-31 18:59:19 -07:00
dougbu fbbc59b392 Add `Name()`, `NameFor()`, and `NameForModel()` helper methods
- `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
2014-03-31 16:07:56 -07:00
dougbu aaa30591a8 Get things working in our world
- usual stuff, especially use of `var` and `[NotNull]`
- remove references to `ExpressionFingerprintChain` and so on to minimize
  classes we bring over now (and remove one cache)
- copy over missing resource
- rework checks in `IsSingleArgumentIndexer()`
2014-03-31 15:31:40 -07:00
dougbu f108315038 Copy over two expression-support classes from legacy MVC 2014-03-31 15:31:39 -07:00
Sornakumar e8a76cfd7f Merge pull request #151 from sornaks/WebFX153
WebFX-153: Add Content() and Json() to the Controller class.
2014-03-31 15:03:56 -07:00
Chris Ross cb982f19bb Update samples. 2014-03-31 13:05:03 -07:00
harshgMSFT 8d4a6c760a Action Selection Convention: Changes for Treating Index method as a default Get/Post method.
Also adds unit tests for the changes.
2014-03-31 12:59:30 -07:00
Chris Ross 60f09fbc93 Make lower level public API. Layering. 2014-03-31 12:47:28 -07:00
Pranav K c72c80c101 Add the ability to correctly determine if a particular field has been validated.
There are several portions of model validation that attempt to avoid
revalidating if a field has been validated. However the behavior of
ModelStateDictionary makes it difficult to distinguish between an
unvalidated field and a field without validation errors. This change
resolves this issue by letting the caller distinguish between the two
cases.
2014-03-31 12:40:38 -07:00
N. Taylor Mullen 2de5d57348 Add PartialAsync and RenderPartialAsync.
This enables Html.PartialAsync and Html.RenderPartialAsync.  It also includes a sample to showcase the features.  This is in reference to WEBFX-95.
2014-03-31 12:19:10 -07:00
Ryan Nowak 87a47f50cc Passing more data to on GetVirtualPath
For link generation to areas, we need to provide the set of values that
the route could potentially provide.

Basically if we know what action we want to reach, we want to know whether
or not a given route could hit that action before giving it the OK to
generate a link.

For instance a route like '{controller}' couldn't hit an action like
'HomeController:DoACoolThing', since it can never provide a value for
'action'. This makes it possible for WebFX to make the right decision
without changing the behavior of any of the routing constructs. This also
has the side-effect of removing a class of order dependencies in routing
that cause bad links to be generated.
2014-03-31 12:05:47 -07:00
Chris Ross 63dc9ad719 Auth: Remove GetAuthType predicate overload. 2014-03-31 12:00:55 -07:00
Chris Ross 60d892b529 Revert new project dependnecy. 2014-03-31 11:28:27 -07:00
Pranav K 90864bcd9c Fixing broken project.json 2014-03-31 11:25:56 -07:00
Pranav K bacc8d1737 * Adding trace listener to ProjectKClone
* Setting Max degrees of parallelism to 4 since too many connections is
* causing MyGet to time out
2014-03-31 11:22:42 -07:00
Glenn Condron 206f74554b fix some typos and updated some parts of the readme. Added GetRuntime.cmd 2014-03-31 11:14:14 -07:00
Chris Ross 097138e813 Auth: Validate acks. 2014-03-31 11:12:22 -07:00
Chris Ross 4347ddfd0f Security contracts. 2014-03-31 11:12:20 -07:00
rowanmiller dabb68cc6d Fix EF InvalidOperationException on Startup
The code that does an 'UPSERT' of seed data on app start was querying
existing instances and attaching as modified of seed instances on the
same context. Now that we track query results this will throw because
the context has two instances of the same entity (same key value).

Swapping to use a temporary context to query existing data.
2014-03-31 10:45:41 -07:00
Chris Ross 83855f8eac Redesign security contracts. 2014-03-31 10:30:57 -07:00
Pranav K bbf51f3556 Re-adding suitable builds 2014-03-31 10:11:55 -07:00
Yishai Galatzer 3e7d8d54f9 CR Feedback
Added and renamed tests
2014-03-31 09:32:47 -07:00
Yishai Galatzer ff5d919e0d Remove unused usings 2014-03-31 09:31:50 -07:00
Yishai Galatzer cd0528b1b2 Link generation related tests 2014-03-31 09:31:49 -07:00
Yishai Galatzer 77ef7a5cde RouteConstraints Step II + III
Include Url Generation support
Add unit tests
Clean issues found by unit tests
2014-03-31 09:31:48 -07:00
Pranav K b705f363ab Update snapshot dependencies to not use suitable build 2014-03-31 06:27:56 -07:00