-
Notifications
You must be signed in to change notification settings - Fork 230
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
BitArray Bitwise operators #2793
Comments
It should be pretty easy to translate e.g BitArray.And to the PostgreSQL & operator, but there's a slight mismatch - the .NET And mutates the BitArray on which it's invoked (and also returns that same instance); in PG it obviously wouldn't do that. I'll need to think a bit more if it makes sense to do that translation given that mismatch. In any case, in the meantime you can use SQL querying where you need these PG operators. |
Thanks, i understand, i am new on looking at translations so i wasn't sure if it was the best way to do it. I start using BitArray but the type i need is BigInteger so when i use it map to numeric and because that postgre don't have the & operator on it, so the ideal think for me is BigInteger map to Bit(256) and because BigInteger in c# has the & maybe instead a translation i need a custom mapping? that could be a good way implement my requirement? Thank a lot! |
So in my specific case i think i solve it, because of that my type really is a BigInteger and it has the & operator i can write a linq valid and then added OnModelCreating in my entity to my property, b.Property(t => t.Gene).HasColumnType("BIT(256)").HasConversion(v => v.ToBitArray(), v => v.ToBigInteger()); where t.Gene is BigInteger? and the column in the database is Bit(256) nullable and i created 2 extensions methods to convert to one another. Thanks for the help! |
Reopening to keep this in the backlog. |
Hi, i am trying to use bit(256) type on postgre because it has the & and | operators but in c# using BitArray and linq i can't make the translation work, i try with the BitArray.And but it cannot be translated and it don't has & operator but it is in postgre.
I am looking at the source and trying with expressions but i can't make it work.
I was trying to make a custom translator but i can't add it, any suggestions on how approch this need?
Thanks!
The text was updated successfully, but these errors were encountered: