Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Add a PropertyHandlerOptions and ClassHandlerOptions class #1088

Closed
mikependon opened this issue Sep 17, 2022 · 1 comment
Closed
Assignees
Labels
enhancement New feature or request fixed The bug, issue, incident has been fixed. todo Things to be done in the future

Comments

@mikependon
Copy link
Owner

mikependon commented Sep 17, 2022

Describe the enhancement

Currently, when you handle the result via PropertyHandler and ClassHandler, the values are returned as argument to the callback method. See below for the property handlers.

TResult Get(TInput input,
            ClassProperty property);

TInput Set(TResult input,
            ClassProperty property);

And below is for the class handlers.

TEntity Get(TEntity entity,
            DbDataReader reader);

TEntity Set(TEntity entity);

This is good, but it is also limiting the user on the given options.


With this User Story, we will enable an option class as the return values to the handler, in which we could in the future extend it to any values required when handling how the models/properties are being hydrated or forwarded to the database.

For property handlers, it is good to introduce the PropertyHandlerOptions class.

public class PropertyHandlerOptions
{
     public ClassProperty Property { get; }
     public DbCommand Command { get; }
     public DbParameter Parameter { get; }
     ...
}

```csharp
TResult Get(TInput input,
            PropertyHandlerOptions options);

TInput Set(TResult input,
            PropertyHandlerOptions options);

For class handlers, it is good to introduce the ClassHandlerOptions class.

public class ClassHandlerOptions
{
     public DbDataReader DataReader { get; }
     ...
}

TEntity Get(TEntity entity,
            ClassHandlerOptions options);

TEntity Set(TEntity entity,
            ClassHandlerOptions options);
@mikependon mikependon added the enhancement New feature or request label Sep 17, 2022
@mikependon mikependon self-assigned this Sep 17, 2022
@mikependon mikependon pinned this issue Sep 18, 2022
@mikependon mikependon added the todo Things to be done in the future label Sep 18, 2022
mikependon added a commit that referenced this issue Sep 18, 2022
…lToDbNull method into the Converter class.
@mikependon mikependon unpinned this issue Sep 19, 2022
@mikependon mikependon added the fixed The bug, issue, incident has been fixed. label Sep 19, 2022
@mikependon
Copy link
Owner Author

The support to this will be available on the releases > RepoDB v1.12.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed The bug, issue, incident has been fixed. todo Things to be done in the future
Projects
None yet
Development

No branches or pull requests

1 participant