emilcicos

user stats

Member SinceNovember 5, 2012
Last VisitSeptember 19, 2014

Contact

developer for

Entity Framework

emilcicos

personal statement

No personal statement has been written.

activity stream

September 12, 2014 - Entity Framework: Modified work item: EF6 String Concatenation SQL Does Not Honor UseDbNullSemantics

September 12, 2014 - Entity Framework: Commented work item: EF6 String Concatenation SQL Does Not Honor UseDbNullSemantics

September 12, 2014 - Entity Framework: Pushed 2bae908ad3f457eaee6cb2f7e2982b39580991d4, CodePlex2457: EF6 String Concatenation SQL Does Not Honor UseDbNullSemantics. The fix flows down the useDatabaseNullSemantics flag to StripNull and does not create the case expression in case it is true.

September 11, 2014 - Entity Framework: Modified work item: UpForGrabs: Query: Cast introduced in query for Int16 parameters that may prevent SQL from using indexes

September 11, 2014 - Entity Framework: Commented work item: UpForGrabs: Query: Cast introduced in query for Int16 parameters that may prevent SQL from using indexes

September 11, 2014 - Entity Framework: Modified work item: Query: Cast introduced in query for Nullable<DateTime> parameters that may prevent SQL from using indexes

September 11, 2014 - Entity Framework: Commented work item: Query: Cast introduced in query for Nullable<DateTime> parameters that may prevent SQL from using indexes

September 11, 2014 - Entity Framework: Modified work item: Query: Cast introduced for enum properties may prevent SQL from using indexes

September 11, 2014 - Entity Framework: Commented work item: Query: Cast introduced for enum properties may prevent SQL from using indexes

September 11, 2014 - Entity Framework: Pushed 3982678d5a359f37e82464aba71ea69452b03ef7, byte and short properties, parameters, constants used with LINQ are up-converted to int, resulting in unnecessary casts in the translated SQL in some cases, which can degrade performance when used in filters. The fix processes comparison operations, removes unnecessary converts, and replaces the involved constants with equivalent ones down-converted to the type of the other operand if the value is in the type's range. Also, because of limitations in the LINQ expressions (Expression.MakeBinary throw if operands are enum and operator is greater than, less than, etc) the fix converts to the underlying type of the enum, the resulting SQL casts being eliminated in SqlGenerator. Comments from contributor: To Convert or to not convert? Fix for issue 186 and 823. This fix is divided in 2 parts, first part kicks in during CQT generation trying to remove redundant Convert, this is necessary since the .Net Framework generates an expression with unnecessary convert even when not needed, there is even a bug on connect, see here https://connect.microsoft.com/VisualStudio/feedback/details/549615/remove-unnecessary-converts-from-expression-trees This can be easily tested with following code (copy and paste in linqpad) void Main() { Expression<Func<Foo, bool>> expression = foo => foo.Bar == Bar.Value1; expression.Dump(); } public class Foo { public Bar Bar { get; set; } } public enum Bar : short { Value1, Value2, } Although with the above fix EF to strips out the unnecessary cast on filter for equality, filter for inequality remain still broken (i.e. the cast is still present) because of how the SqlGenerator handles DbNotExpression, so the second fix is to switch from VisitBinaryExpression to VisitComparisonExpression inside the Visit(DbNotExpression) to allow EF calculate correctly if the cast are really required. Added a bunch of unit test to verify the correctness of the fix and updated some unit test to strip out the unnecessary convert from the expected sql.

projects i'm following

No projects being followed.

forks

No forks.