I am working on an old application which uses a 3 thier approach, however the connection to the database is made via a connection string only and data is manipulated through sql stored procedure.
Is it possible to use LINQ without adding an ADO.NET entity model?
LINQ to Objects, for instance. But are you asking if you can use LINQ to operate on the database directly without setting up any type of entity model? No, not really. Maybe you're a candidate for Entity Framework Code First, but its a little hard to tell based on your description of your setup.
LINQ to Entities provides Language-Integrated Query (LINQ) support that enables developers to write queries against the Entity Framework conceptual model using Visual Basic or Visual C#. Queries against the Entity Framework are represented by command tree queries, which execute against the object context.
Entity Framework is an object-relational mapping (ORM) framework for connecting C# code to external databases, usually SQL Server. LINQ is a query language embedded into C# and a set of extension methods in order to make it useful.
LINQ itself can be used without the database stuff. LINQ to Objects, for instance. But are you asking if you can use LINQ to operate on the database directly without setting up any type of entity model? No, not really. Maybe you're a candidate for Entity Framework Code First, but its a little hard to tell based on your description of your setup.
Linq as in linq-to-sql/linq-to-ef, which means that the SQL will be generated based upon your expression? No.
Linq as in query over the data-in-memory that was loaded using your stored procedures (which means that your queries won't be translated to SQL)? Yes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With