Questions tagged [dapper]

dapper is the micro-ORM for .NET developed and used by the stackoverflow team, focusing on raw performance as the primary aim.

Filter by
Sorted by
Tagged with
2 votes
3 answers
123 views

Is this method for loading data in a C# application recommended?

Goal I'd like to understand if this current method, of loading data and inserting data into a database I currently use is to be avoided? Code I drafted a simple application that loads data and inserts ...
user avatar
  • 53
0 votes
0 answers
783 views

Dapper UOW with Multiple Databases

Scenarios / Requirements: I am working on to convert the existing WebAPI Data Layer to Dapper from EF. The following are the ...
user avatar
  • 121
2 votes
2 answers
88 views

Dapper with shops and payers

I live in the buildings that have 50 people in it and for each floor splits into 2 groups each group is from ~9 people. I'm trying to build an Xamarin app (IOS, ANDROID ,Win10,maybe web app) to make ...
user avatar
0 votes
1 answer
160 views

Is this correct way to setup DB Infrastructure with repository pattern and Dapper

So, I am using Repository pattern with Dapper and ADO.NET. I have my based DB infrastructure setup as follows: ...
user avatar
2 votes
1 answer
67 views

Reducing Inventory Quantity When Order Is Being Processed

I've got a method which removes quantity from inventory when an order is completed. If there is not enough inventory quantity available, the order completion fails and the sql transaction is rolled ...
user avatar
  • 143
4 votes
2 answers
1k views

Repository pattern with Unit of work using ADO.NET in C# to authenticate user from database

So I am using the latest version of Dapper and it works great for mapping my POCO classes but there are some scenarios where I need to return a DataSet instead of ...
user avatar
4 votes
1 answer
183 views

Is my structure of program readable?

Just looking for reviews to improve my coding and my structure of C#. It feels I probably have some unnecessary code that is not needed, been following some YouTube videos to accomplish some tasks. ...
user avatar
  • 53
3 votes
1 answer
474 views

CRUD integration test, is it ok?

I want to test my CRUD operation to a MySql database (I use dapper as my ORM). This is what I wrote with ...
user avatar
1 vote
1 answer
86 views

Getting names/values of multiple properties [closed]

Lets say I have one method, which extracts property name and value: ...
user avatar
4 votes
1 answer
3k views

Dapper "async" and "await using"

I have been building my data access layer and performance is key for the project I am working on. I have chosen to use Dapper and dotnet core 3. I want to make use of the latest and greatest async ...
user avatar
0 votes
1 answer
922 views

Is there a better approach to implementing Dapper with Mediatr?

I'm playing around with using Dapper with Mediatr in a .NET Core API. It's all working nicely. Its a learning project for me so I am just putting together a system that will hold user details ...
user avatar
2 votes
0 answers
222 views

A custom session with transaction support using Dapper

I wanted to write a custom session to act as proxy for a Dapper connection that could support transactions without having to expose any other DB related entities. At first, I thought of opening a ...
user avatar
0 votes
1 answer
2k views

Asynchronously fetching data from the database

The following C# code is written to fetch the Categories data from SQL Server Database using Asynchronous Task for HttpGet. The Dapper library is used as ORM. I ...
user avatar
3 votes
0 answers
3k views

Structure and Implementation of Generic Repository and Unit of Work patterns with Dapper and SqlTransactions

I am attempting to update some legacy code that I work with, but my knowledge of data access is limited to a basic use of Entity Framework and simple Dapper. After some research, I have a loose ...
user avatar
2 votes
1 answer
2k views

Navigation properties with sql/dapper

I want to have the same experiance with slq/dapper for my navigation properties just like in Entity Framework. But I'm not sure which sql query i should use. As you see, every single Resource entity ...
user avatar
1 vote
0 answers
498 views

Simple AuditLog

I am using ADO.NET in my project and I want to have a simple AuditLog. I have below Codes for that but I wounder to know is ...
user avatar
1 vote
0 answers
95 views

Add or modify bunch of data into database

I got my code works fine, but I am not really sure whether the approach that I took is a best practice or not. So, I decided to ask in this forum instead. So here is my situation: I got my model ...
user avatar
3 votes
2 answers
1k views

Multiple methods to connect to MySQL and execute a query

The Code ...
user avatar
  • 147
2 votes
1 answer
2k views

Custom C# Dapper ORM wrapper

I am I C#.NET developer for a few years now... Last couple of months I have started to study design patterns and enterprise software architecture principles so that I will be able to use those ...
user avatar
  • 21
12 votes
2 answers
9k views

Mapper made specifically to work with Dapper

I needed a mapper for a project I have using Dapper. I tried Automapper and other tools that comes with Dapper (Contrib, Rainbow, etc.), but I couldn't make Automapper work properly and the rest doesn'...
user avatar
  • 255
1 vote
1 answer
11k views

Using dapper Unit of Work in 3-tier architecture

The Unit of Work: ...
user avatar
4 votes
1 answer
2k views

Updating complex objects

I'm mainly looking at usage of Dapper, but in general, any comments relating SQL -> C# object mapping best practices would be appreciated. I've got two super simple objects I'm working with: ...
user avatar
  • 113
3 votes
0 answers
511 views

Deriving classes to decorate auto-generated base class code with attributes

Background: I am currently in the process of abstracting and refactoring out EF for Dapper with ...
user avatar
  • 131
1 vote
0 answers
982 views

Interface for Dapper repository

I'm creating a little proposal for the data access layer using Dapper ORM. The code is based in an generic interface IStore: ...
user avatar
4 votes
1 answer
676 views

Micro ORM on the lines of dapper

Designing a micro ORM inspired by Dapper. I'm building this as an exercise to learn. I would appreciate if you guys can review my code. I would also appreciate any suggestions regarding the features ...
user avatar
  • 450
2 votes
2 answers
7k views

Repository Pattern with Dapper + Unity

I just finished the Pluralsight courses about Inversion of Control and Mirco-ORMs, and I am struggling with the implementation aspect of some of the concepts. This is my (simplified) repository ...
user avatar
5 votes
2 answers
19k views

List<dynamic> to ComboBox

This code get a list<dynamic> from a repository class using Dapper. I need to bind this list to a ...
user avatar
1 vote
2 answers
866 views

Manage connection string

I'm using dapper-dot-net for data access in my ASP.NET MVC application. So in order to supply a connection string I've came up ...
user avatar
  • 319
4 votes
2 answers
8k views

Multiple connection string in Web API 2

I have a Web API 2 using Dapper.net, and it's accessed by various client with their own database. Currently, I'm using custom header called Client-Id to identify ...
user avatar
  • 141
3 votes
1 answer
3k views

Integration tests for a repository with the help of AutoFixture

I find it hard to do integration tests for a repository and very time consuming. Things I think about when creating integration tests for a repository: Should I skip them? Should I create an in ...
user avatar
  • 914
1 vote
0 answers
875 views

Repository pattern with data access objects

I started a new ASP.NET project in an effort to better learn SQL and Dapper ORM framework. My idea for data access: Have POCO entities, for each entity have DAO object. When I want to manipulate with ...
user avatar
  • 111
2 votes
1 answer
3k views

Querying a database with Dapper

In the current project that I am working on, we are using dapper to query the database and sometime when mapping from dynamic types to concrete types we end up with a messy block of code. I created a ...
user avatar
  • 349
6 votes
1 answer
4k views

Dapper helper service

I've written a very light wrapper around Dapper to help with unit testing and streamlining the Dapper commands I need. Execute() is a method created to remove the ...
user avatar
  • 205
13 votes
5 answers
13k views

Is this Repository Design Pattern Valid and efficient?

I am using Dapper ORM in my Data access Layer, but I think analysis of the code below doesn't depend upon any specific ORM. What should be the single common place throughout the entire Data Access ...
user avatar
  • 231
3 votes
1 answer
4k views

Using dapper.net and repository pattern in Azure websites

I'm currently on Azure Websites & Azure SQL, some documentation recommends using Async as much as possible as cloud services higher latency and have chances of dropping traffic, but it's also ...
user avatar
  • 131
9 votes
2 answers
2k views

Compare Oracle Table with SQL Server Table and Update/Insert

Below is the current code which is used to update/insert records from Oracle view to SQL Server table using Dapper. There is not a field to check last record updated date in the oracle view so I have ...
user avatar
  • 195