Comments (9)
Will find time to convert FromSqlRaw
. We have our own FromSql
method. Just forgot to create transformation.
from linq2db.entityframeworkcore.
Thank you for this guidance. I was able to make my change in a custom override of TransformExpression!
from linq2db.entityframeworkcore.
I have a patch for this against version 2.0.5, do you accept pull requests? Also, I'm new to expression parsing and this project, so I may have done something terribly wrong, but I thought it might be helpful.
0001-Support-FromSql-when-using-FromRawSql-from-EF.txt
from linq2db.entityframeworkcore.
Which version of EF do you use?
from linq2db.entityframeworkcore.
3.1.3
from linq2db.entityframeworkcore.
I suggest to update to linq2db.EntityFrameworkCore 3.0 - it has a lot of improvements, especially Eager Loading.
Anyway, you can customize current integration before I fix that without changing library code:
Implement your new class MyImplementation
derived from LinqToDBForEFToolsImplDefault
and override TransformExpression
method.
And assign it to LinqToDBForEFTools.Implementation = new MyImplementation()
Sorry a little bit busy now, I'll update library in several days. Your changes looks good, but I need to verify and create tests.
from linq2db.entityframeworkcore.
Thanks for your feedback. I initially tried to override the implementation as suggested, but the changes were to an inline method (LocalTransform) inside the TransformExpression method.
from linq2db.entityframeworkcore.
Hmm, strange, I thought that I have opened everything for customising. It should be easy, something like this:
public override Expression TransformExpression(Expression expression, IDataContext dc, DbContext ctx, IModel model)
{
var expr = base.TransfromExpression(expression, dc, ctx, model);
var expr = expr.Transform(e => {
if ( e is MethodCallExpression and ... bla, bla is FromSqlRaw )
{
// your replace code
return replaced;
}
return e;
});
return expr;
}
Anyway, will find a time to update library.
from linq2db.entityframeworkcore.
Released in 3.1.0
from linq2db.entityframeworkcore.
Related Issues (20)
- IMergeable.UpdateWhenMatched: How can I provide custom setters for SOME of the fields, and use default for others HOT 7
- Library broken with Projectables HOT 3
- Merge doesn't include fields from the output expression HOT 2
- `TempTable<string>` doesn't work with `In` HOT 2
- System.ArgumentException: Expression of type 'System.Byte' cannot be used for constructor parameter of type 'System.Int32' after 7.5.0->7.6.0 upgrade HOT 4
- Setting `BulkCopyOptions` HOT 5
- Log sql query strings when executing InsertWhenNotMatched, UpdateWhenMatched
- System.Diagnostics.UnreachableException: The program executed an instruction that was thought to be unreachable
- "ORA-01704 string literal too long" exception generated when trying to "upsert" BLOB type column in Oracle
- Using EF Core release version 8.0 HOT 3
- Linq2Db fails to translate recursive CTE with ef core TPH HOT 2
- Warning Message for CreateLinqToDbConnection Method HOT 2
- Using CTE with EFCore db context query?
- MissingMethodException: Method not found: SetConvertExpression HOT 1
- Mapping EF `HasConversion<string>` ignored
- BulkCopy throws an Exception with ComplexProperty (Complex Type)
- Integration with EFCore.NetTopologySuite HOT 1
- Locking PostgreSQL Advice
- Not handling JSON-conversion of IList<string>, a native feature in EFCore HOT 2
- Issue with Merge into TPH table and EF Entities
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linq2db.entityframeworkcore.