Git Product home page Git Product logo

Comments (2)

AndreiTsvettsikh avatar AndreiTsvettsikh commented on June 2, 2024

Hi @SuliemanMansouri
First of all - read this article https://stackoverflow.com/questions/35631903/raw-sql-query-without-dbset-entity-framework-core
How to use RawSQL in EF Core. It depends on the used EF Core version.

Official docs for the latest Ef Core version.
https://docs.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.relationalqueryableextensions.fromsql?view=efcore-3.1

What EF Core version do you use? And could you please show the code?

About LINQ or RawSQL - both work fine with 10 rows. You need more data to see the actual execution plan.

Why do we need the Interfaces inside the Application project?

It is a very good question!
I believe better to move interfaces to separate project and architecture layer.
And add a project which "implements" these interfaces.
And "use" these interfaces from the Application layer (and project).
It is Dependency Inversion principle in practice :)

from northwindtraders.

SuliemanMansouri avatar SuliemanMansouri commented on June 2, 2024

Hi, @AndreiTsvettsikh
I was adamant on using Raw SQL using Context.Database, the way I used to do it in EF6. That's what happens when trying to code after 3:00 am in the morning.
Using FromSQL on entities DBSets works fine with keyless entities.
Thanks @AndreiTsvettsikh for pointing which EF Core version I am using.

from northwindtraders.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.