Commit Graph

376 Commits

Author SHA1 Message Date
anpete 71acc74899 Merge branch 'dev' of github.com:aspnet/WebFx into dev 2014-05-01 17:42:48 -07:00
anpete 8208cd6b2f Update file headers 2014-05-01 17:42:33 -07:00
N. Taylor Mullen af18392815 Re-updated System.IO.FileSystem version. 2014-05-01 17:11:23 -07:00
N. Taylor Mullen 40bb9d0421 Update FileSystem package version. 2014-05-01 17:01:13 -07:00
Yishai Galatzer fe8ded0ce6 Fix dev14 crash + temporary? .gitignore 2014-05-01 15:10:48 -07:00
Ryan Nowak 81611f13da TEMPORARILY turning off warnings as errors to unblock the CI 2014-04-30 21:55:17 -07:00
Ryan Nowak 93897b6055 Fixing a resources file that needs to be regenerated 2014-04-30 19:26:36 -07:00
harshgMSFT 3765abdfca Adding Support for LinkGeneration for named Routes.
- Adding HtmlHelpers for route link generation.
- Controller Helpers
- UrlHelper and UrlHelperExtensions
2014-04-30 18:34:46 -07:00
harshgMSFT a1f3c72e08 Updating the sample after namedRoute changes 2014-04-30 16:10:09 -07:00
harshgMSFT 4541295872 Updating BuilderExtensions to use the new 'Named' MapRoute overload. 2014-04-30 15:44:11 -07:00
Ryan Nowak 8ae1865740 Fix for part of #339
Treat actions with a dynamic constraint or httpmethod constraint as
'better' than those with just route constraints.

This is the first criteria used to filter down the 'best' match, so it's
applied before parameter-arity.
2014-04-30 13:25:48 -07:00
Ryan Nowak 20c8dece7b Adding IFilterFactory
This is a generalized factory/provider for filters - TypeFilterAttribute
and ServiceFilterAttribute are now implemented in terms of this interface.
2014-04-30 13:18:10 -07:00
sornaks 185ad31491 Adding an appropriate sample to use ValidationMessage and ValidationMessageFor. 2014-04-30 11:07:02 -07:00
sornaks f17d444b8a Porting the ValidationMessage changes to suit WebFX requirements. 2014-04-30 10:55:45 -07:00
sornaks 458c389aae Port of changes for ValidationMessage from MVC. 2014-04-30 10:55:43 -07:00
sornaks d63d998e95 Introducing DisplayText, DisplayTextFor, Id, IdFor, IdForModel.
Fixing CachedDataAnnotationsModelMetadata to support NullDisplayText.
2014-04-30 10:23:25 -07:00
sornaks 112a5ddc50 Changes enabling TextArea, TextAreaFor.
Changing the interface to directly include Rows and Columns.
2014-04-30 09:42:07 -07:00
sornaks b899cac4c8 Porting TextAreaHelper from existing MVC code. 2014-04-30 09:35:48 -07:00
sornaks e0592d01af Cleaning up sprinkled null checks and adding it to a centralized place - FromStringExpression 2014-04-30 09:29:30 -07:00
David Fowler 488ec2f52e Added default routes overload 2014-04-29 18:00:49 -07:00
Ryan Nowak 2ad1cca549 Issue #312 - TypeFilterAttribute (with sample).
Implmentation for understanding and consuming ITypeFilter was already
there.
2014-04-29 14:18:39 -07:00
Ryan Nowak fe6f023948 Auto-update to project file 2014-04-29 14:17:11 -07:00
Yishai Galatzer bcd0974823 Make the controller available to filters + Sample
GitHub WebFX #300
2014-04-29 10:33:21 -07:00
Yishai Galatzer 297bb5d36d Layout compilation error not showing in browser - GitHub WebFX #286
An exception thrown in a layout (or for that matter anything that is a rendering time exception)
is not bubbling to the end user.

The reason is that the StreamWrite is flushing because it's in a dispose pattern.
The solution is to wrap the stream and prevent writes/flushes if an exception has been thrown.

At the same time we stop writing BOM out to html files by default.

Also specified charset explicitly - so there is matches the encoding of the page.
2014-04-29 10:26:22 -07:00
dougbu f7704ba68f Implement `Editor*()` HTML helpers
- 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
2014-04-28 14:53:07 -07:00
Sebastien Ros b3046a0285 AllowAnonymous can override AuthorizeAttribute
#309
2014-04-28 14:04:10 -07:00
Sebastien Ros e5aeb738e3 Adding a unit test for AuthorizeAttribute
#314
2014-04-28 13:57:29 -07:00
Yishai Galatzer 3636440cae Fix bug# 289
The ordering algorithm was ignoring errors that came from user code,
and only respected errors from model properties
2014-04-28 12:51:55 -07:00
David Fowler 8d53d40647 CR feedback 2014-04-28 11:19:36 -07:00
David Fowler cff4a21e08 Make razor roslyn compilation work on mono
- Added a metadata cache (we need this for core clr). Will consider
moving this into the core
- Skip pdb generation on mono
2014-04-28 11:19:36 -07:00
harshgMSFT 926b335101 Fix for Issue #319 2014-04-28 11:18:15 -07:00
dougbu 66ca046135 Reintroduce `IHtmlHelper` and use it everywhere possible
- no more `IHtmlHelper<object>` in `DefaultDisplayTemplates` and also no
  need for `ViewDataDictionary<object>` in a few places
- mostly removals from `IHtmlHelper<TModel>` but did cleanup comments and
  add `[NotNull]` for `DisplayFor()`, `DisplayNameFor()`,
  `DisplayNameForInnerType()`, and `LabelFor()`
- also add `[NotNull]` for `this` and `Expression` parameters in some
  extension methods
2014-04-28 10:57:36 -07:00
sornaks e21688ffb5 #190 Tighten protections around `ModelStateDictionary` additions 2014-04-28 08:46:47 -07:00
David Fowler fb3528f7f8 Added build.sh 2014-04-27 17:00:45 -07:00
Pranav K f740aabb79 Reviving RangeAttributeAdapter, RequiredAttributeAdapter,
StringLengthAttributeAdapter

* Adding remaining DataTypeAttribute adapter rules
2014-04-26 11:39:29 -07:00
Yishai Galatzer a5afd3eb42 ActionResult implements IActionResult, and all our default implementations now use ActionResult
All controller methods return the specific ActionResult type
2014-04-25 15:57:02 -07:00
Pranav K f5ba63ea1e Fixing missing files in kproj
Fixing typo in sample filter
2014-04-25 14:48:14 -07:00
Ryan Nowak 8eecad9d83 Bringing back UrlHelper.IsLocalUrl
This has been compied verbatim from MVC (intentional). The tests have been
modernized a bit as well, but all the cases covered in the original are
there.

This may be moved to HttpAbstractions at some point in the future.
2014-04-25 14:29:00 -07:00
harshgMSFT f26cc51e2e Introducing AntiForgery System :
- Config is cleaned up to not have IAdditionalDataProvider and SuppressIdentityChecks.

- Added a DefaultClaimUidExtractor which looks for NameIdentifier and if not present serializes entire claims.

- Added HtmlHelper.

- AntiForgery now returns an AntiForgeryTokenSet which represents a tuple of cookie and form tokens.
2014-04-24 18:12:11 -07:00
Pranav K d61915149c DictionaryBasedValueProvider results null when value is not found
* Guard against Dictionary returning null values
2014-04-24 18:10:06 -07:00
Sebastien Ros 0fe028a4dd Implementing Authorize attribute
#272
2014-04-24 16:21:43 -07:00
Pranav K 2ba8780ee0 Reviving MinLength and MaxLength attribute adapters 2014-04-24 15:52:05 -07:00
Pranav K b0c7dc9220 Make IModelBinder and IValueProvider methods async 2014-04-24 15:16:27 -07:00
N. Taylor Mullen d46389888d Modify search location for views.
When areas are not provided area locations are not searched for views.  Also
added tests for search locations in RazorViewEngine failures.
2014-04-24 14:03:36 -07:00
Pranav K 3671e8c5b4 Reviving CompareAttributeAdapter and ModelClientValidationEqualToRule 2014-04-22 23:11:24 -07:00
Pranav K cc00d8cff7 Modify TypeConverterModelBinder to use ValueProviderResult.CanConvertFromString to determine if it can convert a
value

* Adding support for extra type conversions
2014-04-22 23:00:58 -07:00
David Fowler a5899584a2 Remove out.txt added forever ago 2014-04-21 22:59:41 -07:00
David Fowler 40d9fa0019 Added missing dependency 2014-04-21 22:59:26 -07:00
Ryan Nowak 73670fb5d7 CR feedback for filters 2014-04-21 13:34:00 -07:00
dougbu b8731621df Add default `Display*()` templates
- 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
2014-04-19 19:00:42 -07:00