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

1777 Коммитов

Автор SHA1 Сообщение Дата
Doug Bunting 62cc8b3f29 Upgrade to Moq v4.7.142 and Castle.Core v4.2.1
- part of #65
- NuGet added System.Configuration references

- add `[InternalsVisibleTo("DynamicProxyGenAssembly2, ...)]` attribute in MVC to fix more than 70 failures
  - mainly impacted mocks of `internal` interface implementations e.g. `ActionDescriptor` & `IUniquelyIdentifiable`
- split some `Setup(...)` and `SetupGet(...)` lambda expressions in two
  - mainly impacted mocks of types with `protected` constructors e.g. `HttpResponseBase`
- typo in `HttpRouteCollectionTest` should have always broken the test
- not sure why tests using `PortReserver` weren't failing before; tests shouldn't be opening UDP ports
2017-10-24 19:06:05 -07:00
Doug Bunting 4b309584ad Build tests targeting .NET 4.5.2
- precondition for other tool upgrades; xUnit in particular does not support older framework versions

No-op `test` target in Microsoft.TestCommon project
2017-10-23 08:55:23 -07:00
Doug Bunting 634c9d2863 Move to MSBuild v15.0 and latest xUnit MSBuild runner
- change `CultureUtilTest` to use `Thread.CurrentThread`
  - when hosted in latest MSBuild, changing `thread.CurrentThread` changes `Thread.CurrentThread` instead
- find current Microsoft.Build.Tasks assembly in WebStack.tasks.targets, not just the WebApiHelpPage project
- add `$(TestInParallel)`
  - allows user to e.g. build in parallel but test assemblies serially
  - default remains doing everything in parallel
- change build.cmd to set %ErrorLevel% when exiting
- add empty top-level Directory.Build.* files

Use only VS 2017 or later
- ensure same MSBuild features are available in command-line and VS builds
- move `$(MinimumVisualStudioVersion)` project settings to global location and bump required version up

Use Microsoft.NET.Sdk and `<PackageReference/>`s in .NET Standard project
- create a "real" .NET Standard 1.1 assembly, not .NET Portable v5.0

Move to latest version of the xUnit MSBuild runner
- v2.3.0 has a few bugs related to XML results files e.g. xunit/xunit#1515
- switch to current XML results format (required with v2.3.0 but doesn't hurt with later versions)
- make runner discovery version-independent
- add support for `msbuild /t:test` in test project directories
2017-10-23 08:55:04 -07:00
Yaroslav Yakhontov d86dda549c Added FormUrlEncodedMediaTypeFormatter to .NetStandard version of System.Net.Http.Formatting 2017-10-21 19:39:04 -07:00
Doug Bunting e4c8e01a12 Move tests to Newtonsoft.Json v7.0.1
- #72 and also related to #65
- v7.0.1 is the next major version after what the product code is built against (v6.0.4)
  - this version corrects test failures I saw on a machine with .NET 4.7 (#72)
- add binding redirects and include the app.config files in test projects
- avoid new `TypeLoadException`s for Newtonsoft.Json that break numerous tests
  - consistently disable Copy Local (aka `%(Private)` metadata) in `src` projects
  - add Newtonsoft.Json references in test projects that bring it in transitively
    - otherwise, product code is last to mention Newtonsoft.Json assembly
2017-10-19 20:29:32 -07:00
Doug Bunting 3482799183 Add additional `requestContext` and `requestContext.RouteData` null checks
- #6
2017-10-17 14:49:17 -07:00
Jay 11a96246d8 Correcting multiple X-Frame-Options header (#50)
- #7

* According to RFC7034, only these three values, DENY, SAMEORIGIN and ALLOW FROM are valid values and they are mutually exclusive; that is, the header field must be set to exactly ONE of these three values.   This will prevent the CSRF code from inserting it multiple times as well as duplicating it if it was already set elsewhere (e.g. IIS Header)
* Changed var to const string per request.
* Changed const name to avoid SA130 error
* Changing to correct cost naming per standard
2017-09-21 16:26:33 -07:00
Jass Bagga 55c9d83487 Remove GetTempFileName() (#52) 2017-06-28 15:40:42 -07:00
N. Taylor Mullen 3ad7135551 Add support for new style Roslyn dotless commits.
- Roslyn swapped the way they performed dotless commit insertions. They went from:
date => date. => DateTime.  to
date => date. => date => DateTime => DateTime.
The problem with the new approach is that date => DateTime would be rejected and therefore force the editor to reparse and reclassify any dots as HTML giving improper IntelliSense.
- Updated Razor implicit expression edit handling to allow identifier => identifier replacements as long as the identifiers didn't result in keyword or directives.
- Added tests to verify the scenarios impacted.
2017-02-01 15:28:16 -08:00
Doug Bunting f830808d8f Create a .NET Standard 1.1 version of System.Net.Http.Formatting.dll
- bring System.Net.Http in from .NET Standard Library
- use .NET Standard version of Newtonsoft.Json
- bring other dependencies in transitively
- create initial test project, mostly a duplicate of existing "NetCore" one

nits:
- write detailed information to msbuild.log
- clean up trailing whitespace in a couple of test classes
2016-12-12 17:36:00 -08:00
Doug Bunting 7a3c520f07 PR comments
- remove product code change
2016-11-23 16:03:18 -08:00
Doug Bunting b27663e228 Correct test failures on Windows 10 machines
- #37

For more information on the three Win10-specific issues / changes:
- https://msdn.microsoft.com/en-us/library/yck8b540(v=vs.110).aspx#Remarks
  Format of a culture name needs to be invalid to cause `CultureInfo` to throw on Win10.
- https://social.msdn.microsoft.com/Forums/en-US/7e6153ac-68fd-4f2f-8900-117ad0689831/cultureinfogetcultureinfo?forum=netfxbcl
  Date and time formats are different on Win10 for "en-US", "es-PR", and a few other cultures.
- https://connect.microsoft.com/VisualStudio/feedback/details/3051771/httpruntime-appdomainapppath-throws-nullreferenceexception-when-unit-testing
  NREs accessing multiple `HttpRuntime` properties. Change is down in `FileIOPermission`.
2016-11-19 19:12:04 -08:00
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 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
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
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
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
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
Kiran Challa 55d3223938 Documentation fix for issue # 2150 2014-10-16 12:55:47 -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
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
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
N. Taylor Mullen 8c87afb474 Facebook: Add cannot create cookie error page.
- Added a cannot create error page for circumstances that prevent us from creating cookies for users.
- We only re-direct to this error page if we encounter a situation where we may need cookies to function properly.
- Added an authorize filter hook to control when the redirection occurs.
- Added a configuration value to make the no cookies error page act similarly to the existing error page.
2014-08-27 11:30:39 -07:00
jacalvar 2eb192669d Updated the assembly version numbers to 5.2.2.0 2014-08-21 16:48:14 -07:00
jacalvar 30bdcb966c Updated to latest JSON.NET version (6.0.4) 2014-08-21 10:18:40 -07:00
Congyong Su fb3529258c Move OData src and test projects under OData folder
Create an OData folder under aspnetwebstack.
The folder contains:
src
    System.Web.Http.OData: v3 (moved from aspnetwebstack/src)
    System.Web.OData: v4 (moved from aspnetwebstack/src)
test
    System.Web.Http.OData.Test: v3 (moved from aspnetwebstack/test)
    System.Web.OData.Test: v4 (moved from aspnetwebstack/test)
2014-07-30 08:19:24 +08:00
Sam Xu bc464096bf [Codeplex Feature #1896]: Support Open (dynamic) colletion property at
open type.

1. Support the open entity type and the CRUD of open entity type.
2. Support the collection of primitive, complex and enum type as the
dynamic property
2014-07-29 10:47:18 +08:00
Congyong Su 52bb0651fe Update ODL to 6.5
Fix test cases in webapi.odata to take ODL fixes:
Bound action advertised in payload is with cast to the type defining the
action.
ODataUnrecognizedPathException error string change.
Navigation link is built upon read link, instead of edit link.
2014-07-28 16:17:11 +08:00
jacalvar 0ee98f84b4 [Issue #2047] config.EnableQuerySupport() causes errors in Web API OData 5.2 (v3)
https://aspnetwebstack.codeplex.com/workitem/2047

Given an app that has actions attributed with QueryableAttribute, if that
application also uses config.EnableQuerySupport() it will make the actions with
QueryableAttribute fail. config.EnableQuerySupport() adds an EnableQueryAttribute
to the collection of global filters, which causes the action to have two filters
applied: EnableQueryAttribute and QueryableAttribute.

The fix is to check for instances of QueryableAttribute applied to the action or
to the controller when the user calls config.EnableQuerySupport or
config.AddODataQueryFilter without providing an explicit IFilter instance.
In those cases we avoid applying the EnableQueryAttribute to the action globally.
(The filter on the action/controller will still be applied as expected).

If the user used a custom query provider to plug in the QueryableAttribute,
this issue won't apply when updating from 5.1 to a later version as the only
attribute that can be used in 5.1 is QueryableAttribute.

When a customer updates to 5.2-5.3 and provides a custom QueryableAttribute instance to
config.EnableQuerySupport, if he updates his custom QueryableAttribute instance to use
EnableQueryAttribute, he also needs to update all the actions that use
QueryableAttribute on his application to use EnableQueryAttribute to avoid a similar issue
with conflicting filters on such actions.
2014-07-22 11:48:06 -07:00
dougbu 21ff2ec968 Merge branch 'v3.2-rtm' 2014-07-18 11:04:25 -07:00
dougbu 2b12791aee Add `ModelMetadata.HtmlEncode` property
- use new `ModelMetadata.HtmlEncode` property in HTML helpers
 - conditionally in default HTML display and editor object templates (e.g.
   `@Html.DisplayFor()`) when value is non-null and the template is invoked
   with template depth greater than 1
 - unconditionally in `@Html.DisplayText()` and `@Html.DisplayTextFor()`
- test new property and its use

Also test `DisplayTextExtensions`
- unit test gap
2014-07-17 12:17:17 -07:00
Pranav K 3e914bb635 Stylecop fixes 2014-07-14 16:05:20 -07:00
Yishai Galatzer 3fe0d348f0 585: Optimize Razor output rendering to avoid LOH allocations
Instead of creating a string from the StringWriter (_tempWriter)
we will copy the underlying buffer in chunks to the output text buffer.
For large pages this both reduces the total allocations to 1KB as well
as avoid getting into the large object heap.
2014-07-14 15:38:37 -07:00
fenzhao a3dcd16fa3 Issue 1648: [ODataAttrRouting]Invalid route templates are not identified until a request matches an Odata route
Throw exception for invalid path template while initializing the
configuration
https://aspnetwebstack.codeplex.com/workitem/1648
2014-07-04 16:28:25 +08:00
fenzhao e3ee883f75 Issue 2003: ODataBatchHandler should contain more common helpers
https://aspnetwebstack.codeplex.com/workitem/2003
2014-07-04 16:17:30 +08:00
fenzhao 992d10eacc Issue 1941: Parameters Property of SingleEntityFunctionCallNode should
never be null
It is fixed in ODL 6.4
https://aspnetwebstack.codeplex.com/workitem/1941
2014-07-04 16:05:27 +08:00
fenzhao 142f4ff7fc Issue 1594: DefaultODataBatchHandler doesn't handle urls relative to the
batch endpoint properly.
The root cause is that the base uri of ODataMessageReaderSettings doesn't
end with slash.
The fix is only for v3 and v4 works well for all kinds of urls because
ODL v4 will append a slash in the end of the base uri if there isn't one.
2014-07-04 15:45:58 +08:00
Sam Xu 6c5cc2cdb6 [Codeplex #1985]: Make the internal constructor as public in
BoundActionPathSegment
2014-07-03 10:29:34 +08:00
Ryan Nowak cc09dca081 Fix for codeplex #1996 - Nullref on 404 with webapi batching
The issue here is that one of the requests in a batch was matched by an
MVC route when running in web host.

The batch handler uses HttpServer to invoke the individual requests.
Internally the HttpServer forwards the request to an
HttpRoutingDispatcher.

In the web host case, the HttpRoutingDispatcher has a reference to
HostedHttpRouteCollection - which is implemented by matching BOTH WebAPI
and MVC (System.Web) routes. If an MVC route matches, then the produced
IHttpRouteData instance doesn't have its .Route property set as the
underlying route that matched does not implement IHttpRoute.

This causes attribute routing in the controller selector to fail, as we
did not anticipate this case.

Followup filed to consider whether or not this is the right behavior for
the dispatcher/route-collection.

(cherry picked from commit f9a064cbf2)
2014-06-20 14:00:57 -07:00
Ryan Nowak f9a064cbf2 Fix for codeplex #1996 - Nullref on 404 with webapi batching
The issue here is that one of the requests in a batch was matched by an
MVC route when running in web host.

The batch handler uses HttpServer to invoke the individual requests.
Internally the HttpServer forwards the request to an
HttpRoutingDispatcher.

In the web host case, the HttpRoutingDispatcher has a reference to
HostedHttpRouteCollection - which is implemented by matching BOTH WebAPI
and MVC (System.Web) routes. If an MVC route matches, then the produced
IHttpRouteData instance doesn't have its .Route property set as the
underlying route that matched does not implement IHttpRoute.

This causes attribute routing in the controller selector to fail, as we
did not anticipate this case.

Followup filed to consider whether or not this is the right behavior for
the dispatcher/route-collection.
2014-06-20 13:55:11 -07:00
Sam Xu a3cfbbeee0 [Codeplex #1853]: Delete TransientFunction and TransientAction
Summary of this changeset:

1. Remove the TransientFunction and TransientAction functions
2. Remove the IsAlwaysBindable, AlwaysBindable
2014-06-19 10:05:27 +08:00
Sam Xu 476fdc1b74 [Codeplex #1853]: Delete TransientFunction and TransientAction
Summary of this changeset:

1. Remove the TransientFunction and TransientAction functions
2. Remove the IsAlwaysBindable, AlwaysBindable
2014-06-18 15:46:50 +08:00
Congyong Su 7710a52abc Fix 1998 : OData-EntityId header not returned for 204 Patch Responses
If client sends a request with Prefer: return=minimal, and then service
may return an http status code 204 without response content, and also add
a response header OData-EntityId.
"if the service applies a return=minimal preference. In this case, the
response body MUST be empty."

Change Prefer return parameter to: return=representation, and return=minimal
For a response to a create (post/patch/put) operation, add OData-EntityId header,
if response is with status code: NoContent
2014-06-07 12:07:24 +08:00
fenzhao 2e77d3a184 [Codeplex #1973] The context url in the response from a composable
function followed by a property is incorrect.
2014-06-07 11:34:12 +08:00
Congyong Su 566ba41ef1 Fix 1865 : The containing entity is missing in the response header
Location of creating a contained entity.
Fix 1969 : For containment, GenerateLocationHeader() return the wrong URI
2014-06-07 11:05:42 +08:00
fenzhao 47276a9385 [RTM]Issue 1993: OData batch request fails when there are more than 9 entities 2014-06-07 09:10:22 +08:00
jacalvar 39a818802c Fix build break
Added SupressMessage to EdmModelHelperMethods in System.Web.OData.
2014-06-06 13:59:39 -07:00
Sam Xu a3a7e144c6 [Codeplex #1898]: Clean up the ODataMetadataLevel.Default
[Codeplex #1900]: ODataMediaTypes.GetMetadataLevel()` calculates incorrect
default metadata level

Summary of this fix:
1. clean the ODataMetaDataLevel.Default
2. Calculate the correct metadata level
3. fix the corresponding test cases
2014-06-06 16:26:44 +08:00
Sam Xu c7f3407c89 [Codeplex #1840]: Bound Action/Function should return the correct
navigation source

1.If the user defines the return type of action/function by calling
"ReturnsEntityViaEntitySetPath<T>(entitySetPath)", we will call
"TryGetRelativeEntitySetPath(...) to get the target navigation source.

2.If the user defines the return type and the returned navigation source by
calling "ReturnFromEntitySet<T>(entitysetName)", we will define an
instance of "ReturnedEntitySetAnnotation" with the entity set name and set
it as an annotation in the Edm Model. When we dispose the action/function
call, we will get the annotation from the model and use the entity set
name in the annotation to find the target navigation source.
2014-06-05 14:28:02 +08:00
Pranav K 7303170426 RazorParser.Parse method recurses infinitely 2014-06-04 12:21:26 -07:00
N. Taylor Mullen b700c475e4 Modify Facebook hook API to be more like filters.
- Modify tests to account for new behavior.
- Only trigger one Facebook prompt hook per request.
- Expose new ShowPromptResult and JavaScriptRedirectResult.
2014-06-04 12:15:30 -07:00
Tian Pan 13dfa35fe7 [RTM] Fix 1977: Help page references wrong version of MVC host. 2014-06-02 15:06:04 -07:00
N. Taylor Mullen e6dab7ccc1 Remove application start code. 2014-05-30 14:30:31 -07:00
Congyong Su 4c5f054be3 Fix 1937 : Expanded navigation properties should be properly represented
on the response payload

Serialize null single valued navigation property as null in payload.
Serialize null collection valued navigation property as empty collection
in payload.  Previously, they were not serialized, i.e., missing in
payload.
2014-05-30 17:42:55 +08:00
Sam Xu 977bff52ec Migrate To ODL 6.4 2014-05-30 14:42:38 +08:00
Congyong Su 4edbceb662 Fix 1691 : OData v4 Serialization Perf is 10% slower than v3
Based on profiling, found out that if an OData route prefix is null, the
existing ODataRoute.GetVirtualPath method does not call
GenerateLinkDirectly to generate an optimized direct link, instead
base.GetVirtualPath is invoked.
2014-05-30 10:32:57 +08:00
Congyong Su d252143d7e Fix 1571 : Custom OData Actions do not respect 204 return values
Fixed the null reference exception happens on
response.Content.GetType().FullName
Fix for both v3 and v4.
2014-05-30 09:01:22 +08:00
Sam Xu 6c741f7bfa [Codepelx #1938]: ConventionRouting does not support PUT/PATCH to a single-valued navigation property
Add the support *PUT/PATCH* to a single-valued navigation property in
convention routing. But, it is not valid to *Put/Patch" to any collection-valued navigation property.
2014-05-29 11:13:42 +08:00
fenzhao 25c1095f67 [RTM] Issue 1678: We should check for navigability when parsing the OData path 2014-05-29 11:01:14 +08:00
fenzhao c5ff1cf29e [RTM] Issue 1948: bad query string return 500 instead of 400
The root cause is that we catch ODataException only to create error
response, however NotImplementedException, NotSupportedException and
InvalidOperationException may throw for bad query string.
We need to catch all these exceptions to create error response.
2014-05-29 10:27:15 +08:00
fenzhao 4085045947 [RTM] Issue 1947: Cannot include general delimiters in string literals 2014-05-29 09:55:32 +08:00
Sam Xu 13c8adbd83 [Codeplex #1928]: We should not map derived type when building Edm Model.
This fix is not mapping derived types because it will break all the query
composition scenarios.
In this fix, I improve the error message to make
the message actionable and give out the workaround.
2014-05-28 10:09:00 +08:00
fenzhao 8806ffba08 [RTM] Issue 1799: ODataConventionModelBuilder should not add properties defined in base CLR type 2014-05-28 09:47:40 +08:00
dougbu 2c160ea866 Fix 1858: Make public OData annotations immutable
- only one setter was used in a test
2014-05-16 20:55:25 -07:00
N. Taylor Mullen 23b491a241 Add version specific info for new facebook package name. 2014-05-16 19:34:13 -07:00
N. Taylor Mullen ba644b54dc Update dll/namespace of Microsoft.AspNet.Mvc.Facebook.
Changed it to Microsoft.AspNet.Facebook.
2014-05-16 19:34:10 -07:00
dougbu b98a9eccc9 CR comments
- change code comments as suggested
- also address Stylecop issue in test file
2014-05-15 20:54:53 -07:00
dougbu f5c29a64b7 Fix 1907, ODataPathRouteConstraint.Match cannot get correct serviceRoot
- route values are not configured when constraints execute during URI
  resolution; that configuration occurs after all constraints are done
- this causes the UrlHelper to incorrectly calculate the service root,
  expecially when the OData route prefix contains parameters
- in addition ODataPathRouteConstraint should not use UrlHelper since
  constraints operate at a much lower abstraction level
- use RequestUri and route values directly to determine service root

Also fixes #1916, which relates to not using the application base
- that fix comes from different approach taken here

Require that ODataPath be in the RequestUri
- ODataRoute's template ensures this is true
- basically remove a special case from the product code
- fix the tests which required the special case

Revise ODataPath matching to provide ODL with escaped service root
- necessary to avoid incorrect escaping and unrelated links in responses
- add lower-level unit tests of ODataPathRouteConstraint

Handle corner case in `ODataPathRouteConstraint`
- an escaped slash may separate OData path from app base / virtual path
  root / OData prefix before it
- but ODL and `DefaultODataPathHandler` expect a literal '/'
2014-05-15 20:54:49 -07:00
dougbu 18c3a489a7 Revert fix for "1907: ODataPathRouteConstraint.Match cannot get correct serviceRoot"
- leave newly-added test of a problematic scenario

This reverts part of commit 9ac000ebd1.
2014-05-15 20:54:45 -07:00
Sam Xu 441a168649 [Codeplex #1917]: User friendly message should be displayed if user requests service document with accept:application/xml
[Codeplex #1939]: Should do some clean up in ODataMediaTypeFormatters.CreateApplicationXml

codeplex #1917 only mentions to clean up the service document in
application/xml. But, as a fact, ODL only supports Metadata document in
application/xml format. For other payload kinds  (for example, Property, EntityReferenceLink(s), Collection, Error)  are not supported any more as application/xml format in ODL.

codeplex #1939 is required to clean up all other not-supported payload kinds from application/xml format. The requirement is similar with the above and the fix is same.
So, this changeset merges them together. Thanks.
2014-05-16 10:02:57 +08:00
Congyong Su f73f9a6a87 Fix 1748 : OData V4 client unable to parse OData V4 service generated batch response 2014-05-15 17:26:26 -07:00
N. Taylor Mullen 170e5514e2 Updated Facebook package.
Also after evaluating how we utilize FacebookClient's clarified a comment on it's use.
2014-05-15 16:05:37 -07:00
N. Taylor Mullen 67ce0124f6 Remove requirement for permissions on redirect model binder.
Previously if a user wanted to only have default user permissions (which we support) the app would explode on redirects due to the model binder ensuring permissions existed.
2014-05-15 16:03:53 -07:00
N. Taylor Mullen ed8a289eef Modify FacebookAuthorizeFilter flow & add hooks.
Added a PrePermissionPromptHook, a DeniedPermissionPromptHook and added the infrastructure to support custom ActionResult responses from them in order to fully control the Facebook app login flow.  Also added a new method to IFacebookPermissionService to utilize externally and internally for getting a users permission status.
2014-05-15 16:01:55 -07:00
Congyong Su f30cea57ca Fix 1924 : Enable OData attribute routing by default
Fix 1946 : Remove MapODataRouteAttributes api

Add a new api CreateDefaultWithAttributeRouting in ODataRoutingConventions
2014-05-14 22:42:02 -07:00
fenzhao 18eb1208b7 Add parameter alias support for the following node in ParameterAliasNodeTranslator
1. Source of CollectionFunctionCallNode
2. Source of CollectionNavigationNode
3. Source of CollectionOpenPropertyAccessNode
4. Source of CollectionPropertyAccessNode
5. Source of CollectionPropertyCastNode
6. Source of EntityCollectionCastNode
7. Source of EntityCollectionFunctionCallNode
8. Source of SingleEntityCastNode
9. Source of SingleEntityFunctionCallNode
10. Source of SingleNavigationNode
11. Source of SingleValueCastNode
12. Source of SingleValueFunctionCallNode
13. Source of SingleValueOpenPropertyAccessNode
14. Source of SingleValuePropertyAccessNode
2014-05-15 08:57:54 +08:00
Pranav K 09a89d394b Setting context on jquery unobtrusive does not fire ajaxComplete events 2014-05-13 17:16:46 -07:00
Tian Pan 8f13dbe7e8 Fix 1878: Support other message wrappers in `ValidationMessage()`. 2014-05-13 15:40:39 -07:00
Congyong Su 933e9f6578 Fix 1722 : $batch response code should be 200, instead of 202 2014-05-12 11:07:34 +08:00
Sam Xu 4a7ecb336c [Codeplex Issue #1841] Forbid posting a singleton from navigation link
If a navigation source has a navigation property which is binding to a
single-valued object or non-collection valued object, then *post to* this
navigation property is not allowed.
2014-05-12 09:41:00 +08:00
fenzhao 89f9f86196 Add test cases for ParameterAliasNodeTranslator 2014-05-12 09:26:41 +08:00
Ryan Nowak 8d67d42117 Fix for codeplex 1612
Support for absolute or relative URLs in CreateFix for codeplex 1612
2014-05-09 14:18:16 -07:00
davidmatson d924f3d6cf Prefer IReadOnlyList to IReadOnlyCollection in new APIs. 2014-05-09 11:31:43 -07:00
fenzhao 3c99828780 issue 1843: The context URL for a property request is not right.
The root cause is that the ODL path of ODataMessageWriterSettings is not
set correctly.
2014-05-09 22:56:53 +08:00
Congyong Su 596e538edb Fix 1915 : Remove the unnecessary overload from HasEditId and HasReadLink
Remove the string overload of HasEditLink, HasReadLink:
A link has to be a Uri as per OData spec.
The string overload is only referenced by a test method.
2014-05-08 12:00:20 +08:00