|
Sounds like they did it on purpose because they couldn't support the old api going from 2.x to 3.x. Force you to update your code if you update your libs.
The one I remember (between "libs") was in one case you can use a single char for a string split separator, while the other version will (still) insist on an array. You think it's neat and change your code, then find your lib is no longer compatible with your other libs. I also ran into problems thinking all libs should serialize / compress the same ... not. They may actually read and write but the file sizes will be off.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Most of the serialization issues are from them switching from Newtonsoft to System.Text.Json. Beware if you have your own custom converters or attributes to change the serialized property names!
|
|
|
|
|
I can't see how any version of Entity Framework would be able to translate a query using your computed property to a SQL query. It's quite likely that EF Core 2.x was loading the entire table into memory and evaluating the condition as a LINQ-to-objects query instead. One of the breaking changes in 3.x is that it won't do that any more.
Old behavior
Before 3.0, when EF Core couldn't convert an expression that was part of a query to either SQL or a parameter, it automatically evaluated the expression on the client. By default, client evaluation of potentially expensive expressions only triggered a warning.
New behavior
Starting with 3.0, EF Core only allows expressions in the top-level projection (the last Select() call in the query) to be evaluated on the client. When expressions in any other part of the query can't be converted to either SQL or a parameter, an exception is thrown.
There are a couple of ways around this. You could make the property a computed column[^]:
modelBuilder.Entity<Client>()
.Property(acct => acct.IsDeleted)
.HasComputedColumnSql("CAST(IsNull(Deleted, 0) As bit)"); Or use you use a value converter[^] on the property:
modelBuilder.Entity<Client>()
.Property(acct => acct.IsDeleted)
.HasColumnName("Deleted")
.HasConversion(new BoolToZeroOneConverter<int>()); in which case, you'd want to remove the Deleted property, and possibly make IsDeleted writable.
Either option should allow your original query to be evaluated in the database, instead of in memory.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Okay, so I have a set of "packed ranges" which are start and end position pairs stored as adjacent ints in an int array.
For example
var ranges=new int[] { 'A','Z','a','z','_','_' };
would indicate the ranges A-Z, a-z, and the single character _ (range _-_)
Here's the thing. I need them in order. I don't care if they overlap.
So all i do is I sort the array as a flat array of ints.
This *shouldn't* screw with any of my ranges I think?
Can anyone think of a case that will break this? remember i don't care if ranges overlap.
I just need to make sure that after i sort, the same ranges are in the array.
I broke it. LOL answered my own question
Real programmers use butterflies
|
|
|
|
|
Where do I put in a bug report?
The "Hide" and Copy code" links continue to work, even though they've been struck out.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
I noticed that too. You say bug, I say feature. I wonder if it copies the code struck out?
Real programmers use butterflies
|
|
|
|
|
What I have noticed is that the code runs much faster if I set the font in my IDE to DokChampa Regular, but you've really got to avoid handwriting fonts. Some people swear by Comic Sans, but a remarkable percentage of people swear at it.
If you want to look like a real hero, at work, compile the code in something like Algerian, so it runs really slowly, then recompile it in DokChampa just before a customer demo, and pretend to have fixed loads of other people's bugs.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
It's not really a bug, since "strikethrough" is a text feature rather than a functional one to my mind. But ... Bugs and Suggestions[^] is where you report such things.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hand in your Monty Python air-displacement card immediately!
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Is this the five minute argument or the full half hour?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Ni!
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Hail Caesar. If it's not done by sunrise, I'll cut your balls off.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
And that's what the Romans did for me
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Splitter!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You're a very naughty boy!
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
You try and tell the young people today that... and they won't believe ya!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
*BONG!*
That's not Monty Python; it was At Last, the 1948 Show. AIRI, it was written by Tim Brooke-Taylor.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Mark_Wallace wrote: AIRI, it was written by Tim Brooke-Taylor.
And John Cleese & Graham Chapman (along with Marty Feldman) - which is why it also got dragged into the MP Canon: Four Yorkshiremen sketch - Wikipedia[^]
The MP version is probably better known.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You didn't explain how you broke it. Was it something to do with overlapping ranges?
Eg: ['A', 'E', 'C', 'G'] would become 'A'–'C' and 'E'–'G' after sorting, whereas you probably wanted 'A'–'G' instead.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
it never got that far. was a bug in parsing ranges
Real programmers use butterflies
|
|
|
|
|
So I met a road side accident like a week ago and since then been ignoring the obvious signs of injury and trying to continue with my daily life. Now that I couldn't get myself to walk properly, I had no other choice but to visit the doctor. Apart from various muscle ruptures, turns out I have broken toe fingers.
I've been strictly suggested to rest since I've already made my injuries worse by ignoring them. But that's the thing, I had an upcoming squash tournament to play by the end of this month which I won't be able to play now and that's making me real sad.
Why, Why, Why
|
|
|
|
|
Because life's a bitch.
But ... even if you had gone to the quack straight away, you still wouldn't be fixed by the end of next month, let alone this!
Accidents always happen at the least convenient time, that's Einstein's third law of relatives.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: Because life's a bitch.
Can't agree more
OriginalGriff wrote: that's Einstein's third law of relatives.
I read it Einstein's third law of relativity and questioned my high school Physics knowledge for a good 5 minutes
|
|
|
|
|
OriginalGriff wrote: Accidents always happen at the least convenient time,
That infers there's a convenient time. Is there such a thing?
|
|
|
|
|
Of course! I can think of two off the top of my head:
1) When I'm nowhere near it.
2) When it prevents me doing something I didn't want to do anyway.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|