Questions tagged [dapper]
10 questions
3
votes
4 answers
Is it possible to cache data on a REST service that returns paginated data?
Under the REST architecture principles, a RESTful application should be stateless, therefore each time I invoke an ASP.NET 4 REST service (with GET verb) that pulls tens of thousands of records, the REST service paginates them with in chunks of 10…

Rikai no hōhō
- 139
- 1
- 4
3
votes
1 answer
CQRS: how granular should the queries be?
I have a system that uses CQRS with the Queries written using Dapper. It's worked out well, except that there has been a proliferation of query classes that do almost the same thing. The downside of this is that additional queries mean additional…

NMrt
- 479
- 3
- 9
2
votes
1 answer
Best approach to connect master and child table while insert data in tables
I need advice what is best approach to connect data between master and child table.
I have console application written in C# which scrape data from web, process data and insert them in table.
Master table with fields Id, OrdinalNumber, StringDate…

TJacken
- 123
- 5
2
votes
2 answers
Is it better to have a single query that returns all related entities, or separate queries for each case?
Summary
When writing methods to query for related entities, is it better to have a single method for all related entities or separate methods for each combination?
Full Problem
I'm writing repository classes for a .NET MVC project where each…

Michael Brandon Morris
- 209
- 1
- 8
2
votes
2 answers
How to maintain database in open source application?
I'm building my first open source project. It's an API build with C#.
My project has layers
Api itself to receive requests
Services library, for logic.
Database library, for db operations.
I'm using Dapper as orm and i'm creating, altering tables…

Sefa Ümit Oray
- 249
- 2
- 8
1
vote
1 answer
How can I restore an entity from the database while keeping my entities database-independent?
Background
I'm currently working on a project using domain-driven design and Dapper as my ORM. The entities are naturally slightly different than the tables in which they are stored (e.g. _id is protected rather than public, collections are…

JansthcirlU
- 225
- 1
- 6
1
vote
1 answer
Performing many SQL inserts quickly without using BulkCopy
I have a C# system that reads thousands of messages per minute from a Kafka topic. The messages are filtered and I need to insert the filtered messages into a MSSQL table.
A normal insert statement is a too slow and seems to hammer the database with…

Mulciber Coder
- 31
- 4
0
votes
0 answers
Tradeoffs between Testability and Performance when filtering using SQL vs LINQ
My team has recently decided to adopt the CQRS pattern similar to the one used in the famous Microsoft EShopsOnContainers repository. In this solution, the queries are made in Query classes using Dapper and Commands are done in command handlers…

Josh L
- 103
- 5
-3
votes
1 answer
Defer insert data into a database
I need to insert some records into a database at a time when it normally it's not being used, what are some approaches I can take? I have considered using the SQL Server Agent to run some stored procedures, or I could schedule a program to do the…

Immac
- 97
- 4
-4
votes
1 answer
Changing databases in general repository methods when using Dapper
I'm developing a multi-database application. There is one admin database and many customer databases which are identical in structure.
I also have a generic RepositoryBase which looks like the following:
public abstract class RepositoryBase where…

Mitulát báti
- 95
- 4