DapperLib / DapperLib/Dapper

Handling object construction

Open
#1,634 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
18.4k
Forks
3.7k
Avg merge
5h 8m
Merged PRs (30d)
1

Description

Hi team,
We use dapper to populate our generic domain models from database. This is a generic code which populates objects of a given type based on the SQL statement. We need to set some flag in the object when it is being populated from database to avoid certain operations when populating object properties from database. Is there a "generic" way to handle object creation or get access to the object as soon as the instance is created but before any properties are populated ?
Don't want to go about making major changes to the core codebase to get this working in case there is some hooks available in Dapper.

Many thanks
Sharad

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by reviewing Dapper's object materialization behavior for generic domain models populated from SQL, then determine whether a pre-property-population hook can be specified; done means a supported generic way to set object state before database properties are assigned.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, sql
Domain
backend, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.