GithubHelp home page GithubHelp logo

Add Enum support to DBConvert about dbhelpers HOT 3 CLOSED

nvivo avatar nvivo commented on June 12, 2024
Add Enum support to DBConvert

from dbhelpers.

Comments (3)

zyz avatar zyz commented on June 12, 2024

Dbhelpers is strong.But there is a problem, byte [] type errors.
I have modified the below a place.
Add else if.
case TypeCode.Object:
if (type == typeof(Guid))
return ToGuidInternal(value, null);
else if (type == typeof(byte[]))
return value;
break;

I wonder if you how to deal with this problem?

from dbhelpers.

nvivo avatar nvivo commented on June 12, 2024

Good call, I forgot this one. I just created a ticket (#12) and should release in the next version.

from dbhelpers.

nvivo avatar nvivo commented on June 12, 2024

Adding enum support has proven to be quite complicated. While it is possible, it requires too many checks to convert the value correctly, adding a lot of overhead. It also causes an extra check on the To(Type) which I'm not willing to add because of enums.

For now it is better to cast the value from an integer to the enum type.

from dbhelpers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.