DapperLib / DapperLib/Dapper.Contrib
Dapper.Contrib new attribute for automatically set a datetime when inserting or updating a row
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 293
- Forks
- 109
- PR merge metrics
- No merged PRs in 30d
Description
I was thinking at something that could create the insert or update query with GETDATE or GETUTCDATE (in case of sql server) for datetime properties decorated with an attribute.
So you dont have to manually update properties like ChangedDate CreatedDate
It could be useful for inattentive developer or when saving/updating a big list of entities
[AttributeUsage(AttributeTargets.Property)]
public class AutoDateAttribute : Attribute
{
public AutoDateAttribute (QueryAction action, bool useUTC)
{
UseUTC = useUTC;
Action = action;
}
public bool UseUTC { get; }
public QueryAction Action { get; }
}
public enum QueryAction
{
Insert,
Update
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file or test is named. Start by locating Dapper.Contrib's insert and update query-generation entry points and existing attribute handling; clarify how SQL Server GETDATE/GETUTCDATE and the Insert/Update actions should work. Done means the proposed attribute automatically supplies the requested timestamps without manual property updates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100