In WebAPI scenarios involving paramters, there are repeated calls to extract the same set of paramters on the long lifetime ReflectedHttpActionDescriptor. This changes caches them and will prevent one array allocation per request and should improve throughput by 0.3-0.5% depending on the scenario.
- Back to previous MaxDepth handling
- ... but seal property overrides in BaseJsonMediaTypeFormatter subclasses
- Remove unnecessary suppressions; add a couple that were missing
- https://aspnetwebstack.codeplex.com/workitem/1373
- "Error message is not clear when enum that has flags attribute calls EnumDropDownListFor html helper"
- Add new message for case where ModelType has a [Flags] attribute
- Provide EnumHelper.HasFlags(Type) internal method to make determination easy for EDDL()
- Leads to a duplicate call to Nullable.GetUnderlyingType(Type) but only in the failure case
- $(VisualStudioVersion) has value '12.0' in this command window; copied from environment
- build.cmd consistently builds using MsBuild.exe v4
- But VS uses its native MsBuild version and this .targets file works within VS
- Guard v12 settings using $(BuildingInsideVisualStudio)
Whether or not an exception can be handled depends of the catch block
code, so the CallsHandler properly belongs on the catch block class
rather than varying per context on the exception logger context class.
- https://aspnetwebstack.codeplex.com/workitem/1389
- "EnumDropDownListFor helper throws unhandled exception when model state is invalid and create page is loaded again "
- EnumDropDownListFor() attempted to convert ModelState.Value.RawValue to general Enum type
- Fix is to use actual ModelType
This change allows users to configure the casing behavior of simple
membership provider. The simple membership provider will by default
generate a database query that normalizes the case of usernames on the
database side.
This comes with the side effect of obviating any index that the user may
have configured for the user name column.
The fix is to make this behavior configurable. With the new option, it
will be possible to turn off casing normalization, and allow the database
to handle it specific to its collation.
This change allows users to configure the casing behavior of simple
membership provider. The simple membership provider will by default
generate a database query that normalizes the case of usernames on the
database side.
This comes with the side effect of obviating any index that the user may
have configured for the user name column.
The fix is to make this behavior configurable. With the new option, it
will be possible to turn off casing normalization, and allow the database
to handle it specific to its collation.
- Update PCL project files
- Correct usings to provide all necessary types
- Hack a TypeDescriptor.GetConverter(type).CanConvertFrom(typeof(string)) substitute for PCL
Nit: Remove one unused using
- https://aspnetwebstack.codeplex.com/workitem/241
- Refactor JsonMediaTypeFormatter, moving much of it into new BaseJsonMediaTypeFormatter
- All DataContractJsonSerializer support remains in JsonMediaTypeFormatter
- Add new BsonMediaTypeFormatter, another BaseJsonMediaTypeFormatter subclass
- Add (non-standard) MediaTypeConstants.ApplicationBsonMediaType
- Add Dictionary<string, T> and null test data variations -- gaps in previous formatter round-trip tests
Note BSON-specific special cases for null (empty content) and for simple
types and byte[] (Dictionary<string, object> with a single property named
"Value"). May want to publish these workarounds as well as issues with
decimal, uint, and ulong (see BsonMediaTypeFormatterTests.cs).
Nits:
- Make JsonMediaTypeFormatter comments more consistent
- Tighten JsonMediaTypeFormatter contract enforcement
- Merge adjacent #if blocks
- Correct comments referencing JsonMediaTypeFormatter
Test nits:
- Refactor MediaTypeFormatterTestBase slightly to support testing with binary serializations
- Correct value of CommonUnitTestDataSets.ValueAndRefTypeTestDataCollection and remove duplicates from tests using it
- Remove unused DataContractJsonMediaTypeFormatterTests.ValueAndRefTypeTestDataCollectionExceptULong
- Remove unecessary exclusion of TimeSpan data set in HttpAssert.CanRoundTrip(); formatters instead have trouble with DateTime (losing Kind property value)
CancellationToken not being invoked
HttpContent.SerializeToStreamAsync doesn't take in a CancellationToken.
So, there is no easy way to get the CancellationToken to the formatter
while writing response. We are cheating here by passing fake cancellation
tokens. We should fix this when we fix HttpContent.