Граф коммитов

2166 Коммитов

Автор SHA1 Сообщение Дата
Doug Bunting 8b9b851601 Avoid inconsistent NRE in our FxCop rules
- #16
- remove temporary suppression for this rule
- add suppressions for a couple of rules violated only in Debug builds

Tested to confirm all MW120x rule suppresions are needed and therefore that rules work fine.
- removed global override for MW1200; already suppressed in one place it's needed (`RazorParser`)
2016-08-23 11:49:00 -07:00
Doug Bunting ff3565c9fb PR comment: Simplify changes to `TypeCacheSerializerTest` 2016-08-11 09:11:49 -07:00
Doug Bunting 6a5c03903e Avoid FxCop errors about localizing serialized data
- #17
2016-08-11 09:06:00 -07:00
Doug Bunting ddf07644e0 Build s/ latest MSBuild / Visual Studio installed
- #12
- find `MSBuild.exe` and `Microsoft.Build.Tasks.*.dll` for v14.0 before v12.0
- avoid code analysis warnings (about `static`) the latest compiler detects
- correct suppression check ids
- suppress MW1201 FxCop rule for `UriExtensions.TryReadQueryAs()` to avoid #16

nits:
- add solution for tools
- ignore .vs directory
2016-08-10 12:29:04 -07:00
Doug Bunting 1a987f82d6 Change source code and repo license info to .NET Foundation
- #2
- a few manual changes in `License.txt`, `Settings.StyleCop`, `CommonAssemblyInfo.*`, and
  `tools\src\Microsoft.Web.FxCop\Properties\AssemblyInfo.cs`
2016-08-08 22:03:40 -07:00
Doug Bunting aa386adaf6 Remove OData tree 2016-08-08 22:01:50 -07:00
Pranav K 5fa60ca38b Removing unused variable from jquery.unobtrusive-ajax 2015-04-02 07:33:58 -07:00
mgoyet 0323f894d4 Use of jQuery append/prepend functions instead of DOM manipulation functions in asyncOnSuccess function (mode "BEFORE" or "AFTER")
https://aspnetwebstack.codeplex.com/workitem/2247
2015-04-02 07:11:15 -07:00
Doug Bunting be3084402b Correct assertion method in prior commit 2015-02-12 21:24:23 -08:00
martincostello 9efcaf3315 Added support to RequireHttpsAttribute for HTTP 301 permanent redirects. 2015-02-12 21:17:41 -08:00
Pranav K 27e9a28d5b Update assembly version to 5.2.4 2015-02-11 11:14:49 -08:00
Pranav K 0e974218e1 ElementalValueProvider performs incorrect ContainsPrefix check. 2015-01-16 11:29:34 -08:00
Sam Xu 099a84ed9a Upgrade to ODL v6.9. Thanks. 2015-01-13 09:33:52 +08:00
unknown 6b6ed4387f Add the Support for StoreGeneratedPattern Annotation in V3 2014-12-18 15:31:26 +08:00
Yishai Galatzer 598be40346 Fix https://aspnetwebstack.codeplex.com/workitem/2200
The code is now going to cache the query string value
and reparse if the query changed.
2014-12-09 17:29:43 -08:00
Pranav K 0a83ae8b99 Cleaning up PR to match coding guidelines
* Refactoring tests to use facts and adding additional unit tests
2014-11-19 17:27:09 -08:00
Marc Gravell afc70adcb6 Avoid a number of array allocations and unnecessary splits, in particular in OutputCache by moving the logic from SplitVaryByPara minto GetUniqueIdFromActionParameters and tweaking the DescriptorUtil, but also avoids a number of string.Split(params char[]) allocations 2014-11-19 17:26:48 -08:00
Pranav K 1ebbbebd44 Prevent the onReset event in jQuery.unobtrusive.validation from being
recursively invoked.

Work Item: 2172
2014-11-14 16:46:53 -08:00
dougbu dbffb8f458 Add a few more `Display()` and `Editor()` tests 2014-10-31 14:19:25 -07:00
dougbu bb7fad68e4 Add HTML helper tests with various expected encodings
- add `DisplayExtensionsTest` and `EditorExtensionsTest`, were previously
  primarily testing lower-level calls to `TemplateHelper` or the templates

A few intentional gaps...
- do not test every overload of each helper since they share HTML generation
- test only DropDownList() since `DropDownListFor()`, `EnumDropDownListFor()`,
  and `TextBox()` use the same HTML generation
- do not test _every_ value source (parameter value, `ModelMetadata.Model`,
  `ModelStateDictionary` entry, `ViewDataDictionary.Model`,
  `ViewDataDictionary` entry), they are treated identically once found
- do not test id sanitization except in `Id[For[Model]]()` themselves,
  worst case they'll be attribute-encoded (no, that never happens)
- do not test validation attributes since they are treated like any other
  attribute and data comes from `ModelClientValidationRule` instances
2014-10-31 14:19:20 -07:00
dougbu 20de11cb96 Add a couple of scopes useful when unit testing display and editor helpers
- `MetadataOverrideScope` and `TemplateHelpersSafeScope`
2014-10-31 14:19:15 -07:00
dougbu db6c437ae2 Create new `EncodedDataSets` class holding `TheoryDataSet` instances
- update recently-added tests to use new data sets
2014-10-31 14:19:10 -07:00
dougbu ec070c1bb5 Small touch-ups
- correct `DisplayNameExtensions` typo, one test executed `Display()` and not
  `DisplayName()`
- update one parameter name in recently-added `DefaultDisplayTemplatesTest`
  method
2014-10-31 14:19:05 -07:00
Sam Xu 9d9c57193b [Codeplex #2162]: Nullable Enum support in Web API
This fix is to allow nullable enums as function paramters.
2014-10-28 19:17:37 +08:00
Pranav K 8aee6c29e6 When calculcating the value for checkbox fields for remote validation, we
need to determine if the checkbox is checked instead of reading its value

Fixes #2155
2014-10-27 17:01:30 -07:00
Doug Bunting ae8016bee4 Merge branch 'odata-v5.3-rtm' into merge.v5.3-rtm 2014-10-27 14:02:16 -07:00
Sam Xu 9c8e948c9c Upgrade ODataLib Version from 6.8.0 to 6.8.1
Here's the annuncement of ODataLib 6.8.1 release:

http://blogs.msdn.com/b/odatateam/archive/2014/10/20/announcement-odatalib-6-8-1-release.aspx
2014-10-21 09:32:42 +08:00
Kiran Challa 55d3223938 Documentation fix for issue # 2150 2014-10-16 12:55:47 -07:00
Sam Xu dfbd74c26a Upgrade ODataLib version from 6.7.0 to 6.8.0
Here's the annuncement of ODataLib 6.8.0 release:

http://blogs.msdn.com/b/odatateam/archive/2014/09/28/announcement-odatalib-6-8-0-release.aspx
2014-10-09 10:55:38 +08:00
dougbu 4e40cdef9c Add unit tests for #2097 fix 2014-09-24 21:41:35 -07:00
Scott McDonald d24a9b00c9 Ensure any active/open database objects that were created iterating over the IQueryable object are properly closed.
Signed-off-by: Scott McDonald <scott@quantumsoft.com>
2014-09-24 17:07:22 -07:00
Scott McDonald 7ef360ea61 Fix #2097 Ensure any SQL database reader objects are properly closed when using the SingleOrDefault method of the EnableQueryAttribute class.
Signed-off-by: Scott McDonald <scott@movietickets.com>
2014-09-24 17:07:19 -07:00
jacalvar 10e81a6b74 Fix build break 2014-09-23 14:08:51 -07:00
jacalvar 96df699b00 Improved tests for validation in EnableQueryAttribute
Added functional tests to validate restrictions on all functions, operators and
query options.
2014-09-23 12:34:35 -07:00
dougbu 9e06ad3e72 Test more `AllowedFunction` binding and validation cases
- all()/any() of more element types
- arithmetic negate
- casts to more complex and entity types and from string to more types
- group inclusions
- validation of nested expressions

Clean tests up
- correct use of System.Web.Http.OData.Query.Expressions namespace in v4 tests
- improve test and data set names e.g. "Of" -> "If" and removing "Fails"
- test `Address` type only when using `Product` model

Test other flag properties in `ODataValidationSettings`
- remove `[Fact]` tests for specific flags and add `[Theory]` tests
- follow model of recently-added `AllowedFunctions` tests

nits
- make test data more consistent between v3 / v4 test classes
- change some "*Throw*" test methods to allow None; exception thrown regardless
- add missing `// Arrange` etc. comments
- Stream comes before String
- fix a few comment typos
- wrap a couple of long lines
2014-09-23 07:32:17 -07:00
dougbu 152c6b18a3 Check `[NotFilterable]` for collection properties in v4 `FilterQueryValidator`
nits:
- add another missing `default` case in a validation `switch` statement
- clean up "no default validation logic here" comments
2014-09-23 07:08:11 -07:00
Ryan Nowak 6d8208500d Fix for codeplex-2136 - ControllerContext.IsChildAction returns false for
an attribute routed action while inside Controller.Initialize.

The issue is that we haven't selected the 'real' action yet and promoted
its route data when we run Controller.Initialize.

This change adds the required value to data tokens so that we return the
right value inside Initialize.
2014-09-22 11:16:18 -07:00
sornaks a0eb22a4b7 Issue #2092 - [perf] System.net.Http.Formatting.ReadAsAsync - Using the JsonMediaTypeFormatter for the first time is rather expensive (due to reflection cost when creating the default contract resolver). Hence we new up a static collection, such that the second call is much faster. 2014-09-19 13:06:56 -07:00
dougbu 5a630cbb87 Update OData assembly versions to 5.3.1.0 2014-09-19 06:39:17 -07:00
dougbu 37ffefe85b Fix #2122, AllowedFunctions Ignored on Queryable Call
- add tests and fix causes of this bug

Tests:
- correct parameter order of `Assert.Equal()` calls in `FilterBinderTests`
 - confused failure reports
- test ODL cast()/isof() bindings
 - previous v3 tests missing
 - previous v4 isof() tests missing
 - previous v4 cast() tests focused on non-entity types
- test #2122 validation scenarios

Fixes:
- correct typo -- "IsOf" -> "isof"
 - otherwise `isof()` function was ignored during validation
- check `AllowedFunctions` before validating rest of `all()` and `any()`
- add default branches for `switch` on `QueryNodeKind` in `FilterQueryValidator`
 - throw `NotSupportedException` if reached, matching `FilterBinder` behaviour
 - reference unexpected kinds explicitly, showing what's not supported
- add v4 validation of `SingleEntityFunctionCall` nodes
 - leave v3 validation as-is (above); that `FilterBinder` doesn't support these nodes
2014-09-19 06:38:51 -07:00
Sam Xu 34351c2f42 Upgrade DataLib version from 6.5.0 to 6.7.0
Here's the annuncement of ODataLib 6.7.0 release:
http://blogs.msdn.com/b/odatateam/archive/2014/09/05/announcement-odatalib-6-7-0-release.aspx
2014-09-18 16:35:05 +08:00
Ryan Nowak 510fa58406 Fix for Codeplex-2103 - Batch's inner request's Url not being decoded in
WebHost scenarios

The issue here is that when we do batching in a Web Host scenario, we
delegate to the System.Web route table - we do this by wrapping each
HttpRequestMessage in a wrapper that implements HttpRequestBase.

Our adapter isn't doing the right thing with respect to escaping. This
change brings the adapter into compliance and adds an integration test.
2014-09-17 16:22:07 -07:00
Ryan Nowak 5be818f939 Fix for codeplex-#2101 - Allow handling of multipart requests with invalid
media type.

This change adds an overload to ReadAsMultipartAsync which bypasses header
validation for the individual 'parts'. This allows handling of file
uploads where the client doesn't specify a valid media type.

Note that the caller will have to retrieve the header values of the
'parts' using the indexer to the header collection. The getters for
strongly-typed header values will return null if the header is invalid.
2014-09-17 12:44:26 -07:00
Pranav K be67c87472 Modify ViewDataDictionary and ModelStateDictionary to use copy-on-write
semantics to reduce dictionary entry allocations.

* Change WebViewPage to lazy initialize HtmlHelper<object> and
  AjaxHelper<object>.

Fixes #2085
2014-09-11 12:50:03 -07:00
dougbu 55249b2c2b Update assembly version numbers to 5.2.3
- modeled after commit 2eb192669d
- all remaining mentions of "5.2.2" are in OData files
2014-09-09 09:17:16 -07:00
N. Taylor Mullen 2c892c7b51 Fix FB missing permissions query string.
- The HttpContext.Request.QueryString.Get("foo") returns null if the value is empty string.
2014-09-03 16:10:36 -07:00
N. Taylor Mullen 194707c4b7 Update Microsoft.AspNet.Facebook version.
- Due to the CannotCreateCookies hook feature the version is upping to 1.1.0.
2014-09-02 15:01:30 -07:00
Sam Xu f1bbea288d upgrade WSR to 5.2.2 2014-09-02 14:25:24 +08:00
Ryan Nowak 9f6300f8e5 Fix for codeplex-2119 - Performance improvements for razor attribute rendering
Reduces the number of objects created when we're not logging data for
browserlink.

Also some straight-line optimizations for writing attributes.
2014-08-29 17:10:46 -07:00
Pranav K 2e744447d6 Update NormalizeImageFormat to support x-icon mime type for images.
Work Item: 2106
2014-08-27 14:08:42 -07:00