Get Started
Getting started with Impatient for EF Core with SQL Server is easy. Too easy.
Install the
Impatient.EntityFrameworkCore.SqlServerNuGet package.Configure your
DbContextto 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, andTakeLastoperators - 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>HasValueValueGetValueOrDefault()GetValueOrDefault(T)
System.StringLengthConcat(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.DateTimeDateDayDayOfYearHourMillisecondMinuteMonthNowSecondUtcNowYearAddDays(double)AddHours(double)AddMilliseconds(double)AddMinutes(double)AddMonths(int)AddSeconds(double)AddYears(int)
System.MathAbs(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
IgnoreQueryFiltersoperator - Change tracking, along with the
AsTrackingandAsNoTrackingoperators - Entity constructors with parameters
- Lazy loading
- Service properties
- Value conversions, with the caveat that any
Translatorexpressions have to be compatible with Impatient - Compiled queries
- Query Types
- Defining Queries
- Relational null semantics
DbFunctionAttributeandDbFunctionin generalEF.Functions.Like- Connection open/close logging
DbCommandCommandTextandParameterslogging
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.Functionsextensions that are not yet implemented