Skip to content

Latest commit

 

History

History
230 lines (183 loc) · 14.1 KB

documentdb-sdk-dotnet.md

File metadata and controls

230 lines (183 loc) · 14.1 KB
title description services documentationcenter author manager editor ms.assetid ms.service ms.workload ms.tgt_pltfrm ms.devlang ms.topic ms.date ms.author
DocumentDB .NET API & SDK | Microsoft Docs
Learn all about the .NET API and SDK including release dates, retirement dates, and changes made between each version of the DocumentDB .NET SDK.
documentdb
.net
rnagpal
jhubbard
cgronlun
8e239217-9085-49f5-b0a7-58d6e6b61949
documentdb
data-services
na
dotnet
article
12/22/2016
rnagpal

DocumentDB APIs and SDKs

[!div class="op_single_selector"]

DocumentDB .NET API and SDK

**SDK download**[NuGet](https://www.nuget.org/packages/Microsoft.Azure.DocumentDB/)
**API documentation**[.NET API reference documentation](https://msdn.microsoft.com/library/azure/dn948556.aspx)
**Samples**[.NET code samples](documentdb-dotnet-samples.md)
**Get started**[Get started with the DocumentDB .NET SDK](documentdb-get-started.md)
**Web app tutorial**[Web application development with DocumentDB](documentdb-dotnet-application.md)
**Current supported framework**[Microsoft .NET Framework 4.5](https://www.microsoft.com/download/details.aspx?id=30653)

Release Notes

Note

Starting with version 1.9.2 release, you may receive System.NotSupportedException when running queries on partitioned collections if your host process is 32-bit. To avoid this exception, ensure that your host process is 64-bit. For more information, see Troubleshooting.

  • Minor performance fix for the CreateDocumentCollectionIfNotExistsAsync API introduced in 1.11.0.
  • Peformance fix in the SDK for scenarios that involve high degree of concurrent requests.
  • Support for new classes and methods to process the change feed of documents within a collection.
  • Support for cross-partition query continuation and some perf improvements for cross-partition queries.
  • Addition of CreateDatabaseIfNotExistsAsync and CreateDocumentCollectionIfNotExistsAsync methods.
  • LINQ support for system functions: IsDefined, IsNull and IsPrimitive.
  • Fix for automatic binplacing of Microsoft.Azure.Documents.ServiceInterop.dll and DocumentDB.Spatial.Sql.dll assemblies to application’s bin folder when using the Nuget package with projects that have project.json tooling.
  • Support for emitting client side ETW traces which could be helpful in debugging scenarios.
  • Added direct connectivity support for partitioned collections.
  • Improved performance for the Bounded Staleness consistency level.
  • Added Polygon and LineString DataTypes while specifying collection indexing policy for geo-fencing spatial queries.
  • Added LINQ support for StringEnumConverter, IsoDateTimeConverter and UnixDateTimeConverter while translating predicates.
  • Various SDK bug fixes.
  • Fixed an issue that caused the following NotFoundException: The read session is not available for the input session token. This exception occurred in some cases when querying for the read-region of a geo-distributed account.
  • Exposed the ResponseStream property in the ResourceResponse class, which enables direct access to the underlying stream from a response.
  • Modified the ResourceResponse, FeedResponse, StoredProcedureResponse and MediaResponse classes to implement the corresponding public interface so that they can be mocked for test driven deployment (TDD).
  • Fixed an issue that caused a malformed partition key header when using a custom JsonSerializerSettings object for serializing data.
  • Fixed an issue that caused long running queries to fail with error: Authorization token is not valid at the current time.
  • Fixed an issue that removed the original SqlParameterCollection from cross partition top/order-by queries.
  • Added support for parallel queries for partitioned collections.
  • Added support for cross partition ORDER BY and TOP queries for partitioned collections.
  • Fixed the missing references to DocumentDB.Spatial.Sql.dll and Microsoft.Azure.Documents.ServiceInterop.dll that are required when referencing a DocumentDB project with a reference to the DocumentDB Nuget package.
  • Fixed the ability to use parameters of different types when using user-defined functions in LINQ.
  • Fixed a bug for globally replicated accounts where Upsert calls were being directed to read locations instead of write locations.
  • Added methods to the IDocumentClient interface that were missing:
    • UpsertAttachmentAsync method that takes mediaStream and options as parameters
    • CreateAttachmentAsync method that takes options as a parameter
    • CreateOfferQuery method that takes querySpec as a parameter.
  • Unsealed public classes that are exposed in the IDocumentClient interface.
  • Added the support for multi-region database accounts.
  • Added support for retry on throttled requests. User can customize the number of retries and the max wait time by configuring the ConnectionPolicy.RetryOptions property.
  • Added a new IDocumentClient interface that defines the signatures of all DocumenClient properties and methods. As part of this change, also changed extension methods that create IQueryable and IOrderedQueryable to methods on the DocumentClient class itself.
  • Added configuration option to set the ServicePoint.ConnectionLimit for a given DocumentDB endpoint Uri. Use ConnectionPolicy.MaxConnectionLimit to change the default value, which is set to 50.
  • Deprecated IPartitionResolver and its implementation. Support for IPartitionResolver is now obsolete. It's recommended that you use Partitioned Collections for higher storage and throughput.
  • Added an overload to Uri based ExecuteStoredProcedureAsync method that takes RequestOptions as a parameter.
  • Added time to live (TTL) support for documents.
  • Fixed a bug in Nuget packaging of .NET SDK for packaging it as part of an Azure Cloud Service solution.
  • [Fixed] Querying DocumentDB endpoint throws: 'System.Net.Http.HttpRequestException: Error while copying content to a stream'.
  • Expanded LINQ support including new operators for paging, conditional expressions and range comparison.
    • Take operator to enable SELECT TOP behavior in LINQ
    • CompareTo operator to enable string range comparisons
    • Conditional (?) and coalesce operators (??)
  • [Fixed] ArgumentOutOfRangeException when combining Model projection with Where-In in linq query. #81
  • [Fixed] If Select is not the last expression the LINQ Provider assumed no projection and produced SELECT * incorrectly. #58
  • Implemented Upsert, Added UpsertXXXAsync methods
  • Performance improvements for all requests
  • LINQ Provider support for conditional, coalesce and CompareTo methods for strings
  • [Fixed] LINQ provider --> Implement Contains method on List to generate the same SQL as on IEnumerable and Array
  • [Fixed] BackoffRetryUtility uses the same HttpRequestMessage again instead of creating a new one on retry
  • [Obsolete] UriFactory.CreateCollection --> should now use UriFactory.CreateDocumentCollection
  • [Fixed] Localization issues when using non en culture info such as nl-NL etc.
  • ID Based Routing
    • New UriFactory helper to assist with constructing ID based resource links
    • New overloads on DocumentClient to take in URI
  • Added IsValid() and IsValidDetailed() in LINQ for geospatial
  • LINQ Provider support enhanced
    • Math - Abs, Acos, Asin, Atan, Ceiling, Cos, Exp, Floor, Log, Log10, Pow, Round, Sign, Sin, Sqrt, Tan, Truncate
    • String - Concat, Contains, EndsWith, IndexOf, Count, ToLower, TrimStart, Replace, Reverse, TrimEnd, StartsWith, SubString, ToUpper
    • Array - Concat, Contains, Count
    • IN operator
  • Added support for modifying indexing policies
    • New ReplaceDocumentCollectionAsync method in DocumentClient
    • New IndexTransformationProgress property in ResourceResponse for tracking percent progress of index policy changes
    • DocumentCollection.IndexingPolicy is now mutable
  • Added support for spatial indexing and query
    • New Microsoft.Azure.Documents.Spatial namespace for serializing/deserializing spatial types like Point and Polygon
    • New SpatialIndex class for indexing GeoJSON data stored in DocumentDB
  • [Fixed] : Incorrect SQL query generated from linq expression #38
  • Dependency on Newtonsoft.Json v5.0.7

  • Changes to support Order By

    • LINQ provider support for OrderBy() or OrderByDescending()

    • IndexingPolicy to support Order By

      **NB: Possible breaking change** 
      
      If you have existing code that provisions collections with a custom indexing policy, then your existing code will need to be updated to support the new IndexingPolicy class. If you have no custom indexing policy, then this change does not affect you.
      
  • Support for partitioning data by using the new HashPartitionResolver and RangePartitionResolver classes and the IPartitionResolver
  • DataContract serialization
  • Guid support in LINQ provider
  • UDF support in LINQ
  • GA SDK

Release & Retirement Dates

Microsoft will provide notification at least 12 months in advance of retiring an SDK in order to smooth the transition to a newer/supported version.

New features and functionality and optimizations are only added to the current SDK, as such it is recommended that you always upgrade to the latest SDK version as early as possible.

Any request to DocumentDB using a retired SDK will be rejected by the service.


Version Release Date Retirement Date
1.11.1 December 21, 2016 ---
1.11.0 December 08, 2016 ---
1.10.0 September 27, 2016 ---
1.9.5 September 01, 2016 ---
1.9.4 August 24, 2016 ---
1.9.3 August 15, 2016 ---
1.9.2 July 23, 2016 ---
1.9.1 Deprecated ---
1.9.0 Deprecated ---
1.8.0 June 14, 2016 ---
1.7.1 May 06, 2016 ---
1.7.0 April 26, 2016 ---
1.6.3 April 08, 2016 ---
1.6.2 March 29, 2016 ---
1.5.3 February 19, 2016 ---
1.5.2 December 14, 2015 ---
1.5.1 November 23, 2015 ---
1.5.0 October 05, 2015 ---
1.4.1 August 25, 2015 ---
1.4.0 August 13, 2015 ---
1.3.0 August 05, 2015 ---
1.2.0 July 06, 2015 ---
1.1.0 April 30, 2015 ---
1.0.0 April 08, 2015 ---

Troubleshooting

If you receive an error that partition routing information cannot be extracted from the query when running in a 32-bit process, do one of the following in Visual Studio:

  • For executable applications, on the Project menu, click Project name Properties... Then, on the Build tab, clear the Prefer 32-bit box.
  • For VSTest based test projects, on the Test menu, select Test Settings | Default Processor Architecture as X64.
  • For locally deployed ASP.NET Web applications, on the Tools menu, select Options | Projects and Solutions | Web Projects, and then check the Use the 64 bit version of IIS Express for web sites and projects box.

FAQ

[!INCLUDE documentdb-sdk-faq]

See Also

To learn more about DocumentDB, see Microsoft Azure DocumentDB service page.