|
EF isn't intended for use with SPs. If you have a thousand pre-written SPs and insist on working with them then you're using the wrong technology, that's not the fault of EF, use ado.net instead.
As for updating the auto-generated classes, again you're not supposed to. They are marked as partial so any edits you want to do can be done on your own partial class that you have to create yourself.
|
|
|
|
|
You can't annotate properties in partial classes. Being partial is pointless in that regard. Now, if they made all the entity properties virtual, I could just inherit the generated entity and override the properties with annotations. That would be a billion times more useful.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
modified 30-Mar-19 13:53pm.
|
|
|
|
|
|
Thanks, I didn't know about that. I'll give it a shot. (But EF6 still sucks today.)
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
NHibernate is the name of the shining magic bullet that will make all your pain go away, he he
|
|
|
|
|
We can't use nHibernate - it's not on the ASL.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Lucky you, I was coerced into using it where I work
|
|
|
|
|
|
... are teasing an anteater by taunting and then running away, ducking into an anthill ahead of his tongue and then emerging to do the same thing again to the anteater's frustration.
They ran into a third ant, who was vegging out watching baseball and suggested he get in on the fun.
He stretched in his recliner, yawned, and settled back again: "Nah ... that sounds too much like aardvark to me."
Where the heck is me coat?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Adam Ant would have loved this joke
|
|
|
|
|
So I've got this web app, EF Core with (automatic) Migrations, Azure AD authentication and an Azure Key Vault.
All works fine on my machine (of course), but now I deploy to Azure and it all goes to hell.
No problem, I'll check my logs... Except there aren't any!
I'll check Application Insights, but nothing!
I'll remove lines one by one until the app starts working... (Old school "debugging"!)
It's not EF Core Migrations and it's not Azure AD authentication, those work fine.
I've traced the line to b.ConfigureKeyVault() in the Program.cs.
So... try catch around it, log the exception and go!
EXCEPT IT WON'T FRIGGIN LOG ANYTHING!!!
The application just stops and that's it.
I get a generic HTTP Error 502.5 - Process Failure.
When I remove the line I get some logging I added in case everything succeeds.
When I add the line the application crashes again, it won't hit my catch and everything stops.
I can't debug it remotely as the app isn't running to begin with.
I've checked the key vault permissions and those should be ok.
This issue has cost me a day now and it's really pissing me off!
|
|
|
|
|
Application.ThreadException ?
Message Signature
(Click to edit ->)
|
|
|
|
|
I FOUND IT!!!
When I move my key vault config from appsettings.Development.json to appsetings.json everything works.
Probably because the Development.json is read after Program.cs, but the connection string for the database is in the key vault.
So in Program.cs I do my EF Core Migration, which is trying to read a connection string that isn't there (yet).
There was also an error in the key vault access policies.
Apparently, I had two app registrations with the same name, one I made, and one Azure generated (the MSI).
The key vault needs access to the MSI, not my own app registration.
The problem is that the generated MSI is not visible in the Azure AD, so it's kind of hard to check, but it does show up in the key vault.
Still no idea why everything worked locally though...
Perhaps it reads the Configuration differently in Azure?
All in all, I've learned a lot and I hate the world just a little bit more
|
|
|
|
|
|
My nephew is in year 1. He is 5 years old. He want me to buy him a book on meteorite for his birthday present. I am looking on google but failing to find something decent.
I want to buy one with lots of images but also with acutal description of meteorite. Any suggestion on such book?
Zen and the art of software maintenance : rm -rf *
Maths is like love : a simple idea but it can get complicated.
|
|
|
|
|
|
That one seems very down to earth.
Socialism is the Axe Body Spray of political ideologies: It never does what it claims to do, but people too young to know better keep buying it anyway. (Glenn Reynolds)
|
|
|
|
|
|
Thank you for your suggestion. I bought this one.
Zen and the art of software maintenance : rm -rf *
Maths is like love : a simple idea but it can get complicated.
|
|
|
|
|
Footfall?[^]
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Lucifer's Hammer would probably be a "better" choice...
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
The problem is in deciding which one contains the most trite "user experience" in reading them.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
OMG, just heard on the news that a giant meteorite caused the extinction of the dinosaurs
Hope your nephew won't be shocked about that!
|
|
|
|
|
Reward[^]
Hits the nail on the head!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Quote: Perseverance is the hard work you do after you get tired of doing the hard work you already did.
|
|
|
|