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

TypeHandler not working? #217

Closed
kg6zgj opened this issue Oct 18, 2019 · 2 comments
Closed

TypeHandler not working? #217

kg6zgj opened this issue Oct 18, 2019 · 2 comments

Comments

@kg6zgj
Copy link

kg6zgj commented Oct 18, 2019

these are never being called on the simpleCRUD calls.

is this by design?

 public class LongArrayHandler: SqlMapper.ITypeHandler
    {
        public object Parse(Type destinationType, object value)
        {
            return JsonConvert.DeserializeObject<long[]>(value.ToString());
        }

        public void SetValue(IDbDataParameter parameter, object value)
        {
            parameter.Value = (value == null)
                ? (object)DBNull.Value
                : JsonConvert.SerializeObject(value);
            parameter.DbType = DbType.String;
        }
    }

@kg6zgj
Copy link
Author

kg6zgj commented Oct 18, 2019

looks like we are filtering out complicated types. I wonder if it would be better to check for registered type handlers and ignore those when checking .IsSimpleType()

CyrilB1531 pushed a commit to CyrilB1531/Dapper.SimpleCRUD that referenced this issue Dec 13, 2019
@ericdc1 ericdc1 closed this as completed Mar 15, 2021
@ericdc1
Copy link
Owner

ericdc1 commented Mar 15, 2021

Added comment on the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants