Questions tagged [linq2db]

LINQ to DB is a fast LINQ database access library offering a simple, light, fast, and type-safe layer between your POCO objects and your database.

LINQ to DB is a fast LINQ database access library offering a simple, light, fast, and type-safe layer between your POCO objects and your database.

Architecturally it is one step above micro-ORMs like Dapper, Massive, or PetaPoco, in that you work with LINQ expressions, not with magic strings, while maintaining a thin abstraction layer between your code and the database. Your queries are checked by the C# compiler and allow for easy refactoring.

However, it's not as heavy as LINQ to SQL or Entity Framework. There is no change-tracking, so you have to manage that yourself, but on the plus side you get more control and faster access to your data.

See Wiki for more details.

Code examples and demos can be found here.

183 questions
0
votes
1 answer

Linq2db, SQLite, connection pool

I can't use built-in connection pooling of SQLite. It doesn't work with WPF apps. It is stated in the source code of SQLiteConnectionPool class. I would like to implement my own connection pool for SQLite connections using Linq2DB DataConnection…
ekalchev
  • 762
  • 7
  • 24
0
votes
1 answer

Update fails when using results of a flatten groupjoin (lambda)

I'm trying to update a whole table to modify some columns and store Id from another table in there. The following code fails at the update statement and I can't figure out why. db.gt_s_one .GroupJoin(db.access_mode, l =>…
jplanglais
  • 77
  • 9
0
votes
2 answers

Linq2DB EF Core Join Tables In Loop

I am using linq2db.EntityFrameworkCore I need to join to DocumentMetadataValue table join to Document table dynamically. Left joined tables can be like DocumentMetadataValue_1, DocumentMetadataValue_5, DocumentMetadataValue_9,…
Anonymous Creator
  • 2,968
  • 7
  • 31
  • 77
0
votes
1 answer

Linq2Db Template File causing an SSL Connection error with a file not found exception

I am trying to generate my database mappings using Linq2Db connecting to a MySQL instance. However, when I attempt to run the template file in Visual Studio, it causes an SSL connection error as well as a File Not Found exception saying that it…
JoshUA
  • 1
0
votes
1 answer

Linq2db issue witth linqtodb.ttinclude

Hello I've have a project created with linqtodb with a database in MySQL and make an upgrade so I can work with the Windows 10, the problem grow and I've been forced to remove the linq2db and all dependencies and now when I've reinstalled and try to…
hidura
  • 681
  • 3
  • 11
  • 36
0
votes
0 answers

linq2db not able to create table for inherit class

I have a parent class with some column definition and different child class to inherit the column definition and some extra column. However, I can't get it to work. The create table call always fail. [Table] class Parent { [column] public int…
sgwong513
  • 275
  • 1
  • 8
0
votes
1 answer

Calling a database stored function or stored proc that returns a value

Using linq2db with an oracle 12 database, how can I call a stored function or a stored procedure that returns a value? From the info I could find, the solution seemed to be to use: IEnumerable QueryProc( this DataConnection connection, …
J. Volkya
  • 993
  • 3
  • 14
  • 33
0
votes
1 answer

Linq2DB and query for dynamic

I'm trying to perform a query without having created a model that maps it. Consider this snippet public IDictionary GetParentelaMapping() { using (var conn = dataContextFactory.Create()) { var result =…
advapi
  • 3,661
  • 4
  • 38
  • 73
0
votes
1 answer

Can linq2db create query that has ORDER BY by specific column but without including that column in SELECT?

I am using linq2db as ORM for my project (ASP.NET Core 2.2) with Oracle database. I want to get list of products from database ordered by a specific column but this column doesn't need to be shown on the front-end client. SQL query that I am looking…
mlst
  • 2,688
  • 7
  • 27
  • 57
0
votes
1 answer

Linq2DB Parameterized Schema

Ok, this is definitely my last question about Linq2DB! Maybe... I've gotten through some of the learning curve with Linq2DB for a project that will work against DB2/iSeries data. One problem though is that while my code works against my test…
Matt McNabb
  • 362
  • 4
  • 15
0
votes
1 answer

Linq2DB arbitrary Where clause

I'd like to be able to implement a search method that can take any arbitrary properties of my POCO class as arguments. This works well: public static IEnumerable Search(DataContext context, Func predicate) { return…
Matt McNabb
  • 362
  • 4
  • 15
0
votes
0 answers

Linq2db for SQLite - Xamarin form

When connect to SQLite always got this exception {System.TypeInitializationException: The type initializer for 'LinqToDB.Data.DataConnection' threw an exception. ---> System.TypeLoadException: Could not load type of field…
Sutinee M.
  • 33
  • 7
0
votes
1 answer

Linq2db scaffolding and association naming

I've tried to scaffold an existing database using the t4 file as described here Now I've found that the relation I've have really ugly looking naming,consider this case /// /// FK_XX_CONVENZIONI_XX_COMPAGNIE_BackReference ///…
advapi
  • 3,661
  • 4
  • 38
  • 73
0
votes
1 answer

linq2db provider for Postgre SQL 10

I want to use linq2db with Postgre SQL 10, but I can't see any Postgre SQL provider of this version. I found out providers for such versions: public enum PostgreSQLVersion { v92, v93, v95, } Also, I have run example app with the latest…
0
votes
2 answers

Creating a database with linq2db

I am writing a small program to test out linq2db. What I want to do is create the database if it does not already exist. Most(all?) of the linq2db documentation assumes an existing database. I check if the database exists and if not create an empty…
Pete Freeman
  • 11
  • 1
  • 1