Get Started
Getting started with Impatient for EF Core with SQL Server is easy. Too easy.
Install the
Impatient.EntityFrameworkCore.SqlServer
NuGet package.Configure your
DbContext
to use Impatient:services.AddDbContext<NorthwindDbContext>(options => { options .UseSqlServer(connectionString) .UseImpatientQueryCompiler(); });
Cross arms, tap feet, run queries.
Supported Query Operators
Impatient supports just about every standard query operator provided by the .NET Framework. In fact, it may be easier to enumerate which operators are not supported:
Aggregate
, because databases aren't cool enough for this yet- The newer
Append
,Prepend
,SkipLast
, andTakeLast
operators - Some materialization operators:
ToDictionary
,ToHashSet
, andToLookup
Enumerable
-only operators likeEmpty
,Range
, orRepeat
- Any overload of an operator that accepts
IEqualityComparer<T>
orIComparer<T>
Unless the operator in question is in the above list, or is newer than Append
, Impatient can translate it.
Supported BCL Translations
Impatient supports translating a healthy assortment of BCL APIs into SQL, with more still in the works.
System.Nullable<T>
HasValue
Value
GetValueOrDefault()
GetValueOrDefault(T)
System.String
Length
Concat(params string[])
Concat(string, string)
Concat(string, string, string)
Concat(string, string, string, string)
Contains(string)
EndsWith(string)
IndexOf(char)
IndexOf(string)
IndexOf(char, int)
IndexOf(string, int)
IndexOf(char, int, int)
IndexOf(string, int, int)
IsNullOrEmpty(string)
IsNullOrWhiteSpace(string)
Replace(char, char)
Replace(string, string)
StartsWith(string)
Substring(int)
Substring(int, int)
Trim()
TrimEnd(params char[])
with empty argumentsTrimStart(params char[])
with empty argumentsToUpper()
ToLower()
System.DateTime
Date
Day
DayOfYear
Hour
Millisecond
Minute
Month
Now
Second
UtcNow
Year
AddDays(double)
AddHours(double)
AddMilliseconds(double)
AddMinutes(double)
AddMonths(int)
AddSeconds(double)
AddYears(int)
System.Math
Abs(decimal)
Abs(double)
Abs(float)
Abs(int)
Abs(long)
Abs(sbyte)
Abs(short)
Acos(double)
Asin(double)
Atan(double)
Atan2(double, double)
Ceiling(decimal)
Ceiling(double)
Exp(double)
Floor(decimal)
Floor(double)
Log(double)
Log(double, double)
Log10(double)
Cos(double)
Pow(double, double)
Sqrt(double)
Sign(decimal)
Sign(double)
Sign(float)
Sign(int)
Sign(long)
Sign(sbyte)
Sign(short)
Sin(double)
Tan(double)
Truncate(decimal)
Supported EF Core Features
Almost all of the querying features of EF Core are supported; however, there are some that are not, and there are also some behavioral discrepancies to be aware of.
Here is the list of supported features:
- Async methods
- Owned types
- Table splitting
- Shared tables
Include
,ThenInclude
, and includes for derived types- Query filters, along with the
IgnoreQueryFilters
operator - Change tracking, along with the
AsTracking
andAsNoTracking
operators - Entity constructors with parameters
- Lazy loading
- Service properties
- Value conversions, with the caveat that any
Translator
expressions have to be compatible with Impatient - Compiled queries
- Query Types
- Defining Queries
- Relational null semantics
DbFunctionAttribute
andDbFunction
in generalEF.Functions.Like
- Connection open/close logging
DbCommand
CommandText
andParameters
logging
Likewise, here is the list of unsupported features:
FromSql
- 'Null navigation protection' during client evaluation of lambda expressions
- Propagation of navigation nullability after a 'manual left join'
- Paging with
ROW_NUMBER
- An assortment of
EF.Functions
extensions that are not yet implemented