Overview
Basics
Operations
Providers
Providers
Azure Cosmos DB
Installation Requirements
Install the NuGet package Microsoft.EntityFrameworkCore.Cosmos
An example web application is available for this database engine on our GitHub page.
Last tested versions
- 7.0.0
- 6.0.0
Issues with Engine
-
Average Rounding issue with int and long
Using an average function with int and long datatypes returns a whole number instead of a double with decimal places
-
Sum returning null for properies with no values
Normally a Sum operation will return 0 when suming a property where all objects have a null value for the property. In this case, Cosmos returns a null instead of 0.
Supported Data Types and Operations
See the table below to view supported data types and operations.
Supported Data Types By Version
Version | bool | bool? | byte | byte? | char | char? | double | double? | DateTime | DateTime? | DateTimeOffset | DateTimeOffset? | decimal | decimal? | float | float? | Guid | Guid? | int | int? | long | long? | sbyte | sbyte? | short | short? | Single | Single? | string | string? | TimeSpan | TimeSpan? | UInt16 | UInt16? | UInt32 | UInt32? | UInt64 | UInt64? | UInt128 | UInt128? |
.NET 7 | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
.NET 6 | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | No |
Information for .NET Standard 2.1, 2.0, 1.3, .NET 4.5, 4.0 and 3.5 Coming Soon!
Supported Operations By Version
Version | Select | Distinct | Sort | Average | Count | Minimum | Maximum | Sum | Null | NotNull | Between | Equal | NotEqual | LessThan | LessThanOrEqual | GreaterThan | GreaterThanOrEqual | InSet | NotInSet | Contains | StartsWith | EndsWith |
.NET 7 | Yes | Yes | Yes | decimal double float int long Single | decimal double float int long Single | decimal double float int long sbyte short Single UInt16 UInt32 UInt64 | decimal double float int long sbyte short Single UInt16 UInt32 UInt64 | decimal double float int long Single | Yes | Yes | byte char DateTime DateTimeOffset decimal double float int long Guid sbyte short Single TimeSpan UInt16 UInt32 UInt64 | Yes | Yes | byte char DateTime DateTimeOffset decimal double float Guid int long sbyte short Single TimeSpan UInt16 UInt32 UInt64 | byte char DateTime DateTimeOffset decimal double float Guid int long sbyte short Single TimeSpan UInt16 UInt32 UInt64 | byte char DateTime DateTimeOffset decimal double float Guid int long sbyte short Single TimeSpan UInt16 UInt32 UInt64 | byte char DateTime DateTimeOffset decimal double float Guid int long sbyte short Single TimeSpan UInt16 UInt32 UInt64 | Yes | Yes | Yes | Yes | Yes |
.NET 6 | Yes | Yes | Yes | decimal double float int long Single | decimal double float int long Single | decimal double float int long sbyte short Single UInt16 UInt32 UInt64 | decimal double float int long sbyte short Single UInt16 UInt32 UInt64 | decimal double float int long Single | Yes | Yes | byte char DateTime DateTimeOffset decimal double float int long sbyte short Single TimeSpan UInt16 UInt32 UInt64 | Yes | Yes | byte char DateTime DateTimeOffset decimal double float int long sbyte short Single TimeSpan UInt16 UInt32 UInt64 | byte char DateTime DateTimeOffset decimal double float int long sbyte short Single TimeSpan UInt16 UInt32 UInt64 | byte char DateTime DateTimeOffset decimal double float int long sbyte short Single TimeSpan UInt16 UInt32 UInt64 | byte char DateTime DateTimeOffset decimal double float int long sbyte short Single TimeSpan UInt16 UInt32 UInt64 | Yes | Yes | Yes | Yes | Yes |
Information for .NET Standard 2.1, 2.0, 1.3, .NET 4.5, 4.0 and 3.5 Coming Soon!