|
I can't hang with EF6. It just takes too much control and won't let me fix it's "nuances".
I'm going to keep it for the Identity stuff because the two are too tightly integrated and I have real and more important work to do. For everything else, I wrote a static class that uses ADO to do simple set/get via stored procs, and a method that uses reflection to build a list of the specified entity for the "get data" stuff.
EF6 is probably great for people that don't/won't rely so heavily on stored procs (it REALLY doesn't work very well in that regard), but for my circumstances, ORMs are to avoided, shunned, and denigrated at all costs.
I don't know if EF7 is any better, but since we can't move to .Net Core where I work, we'll probably never know.
EDIT =======================================
After spending a day and a half replacing the EF models with my own ADO-based code, I'm back to where I was on Friday, and after I've documented what I did and why I did it, I'll be able to actually work on the app again.
".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 7-Apr-19 14:31pm.
|
|
|
|
|
We have several enterprise web apps that run just fine on EF.
Adding/maintaining sprocs to EF can be a bit tricky, but totally doable. You can't work with a sproc in EF like you can an entity or a view for that matter in regards to Linq, etc.
We only use sprocs for web page reporting, etc.
but too each their own. good luck on your alternative.
|
|
|
|
|
Slacker007 wrote: Adding/maintaining sprocs to EF can be a bit tricky,
We honestly don't have time for "tricky". Besides, my dboject code is much faster than EF, and it's easy to adapt to new requirements with little/no research.
We've had almost two dozen different devs involved in the app I work on over the last 13 years. For a new dev coming onboard, learning our whacked out business rules is daunting enough. I don't want them to have to deal with figuring out our special considerations for EF6 as well (NOBODY on our team has any real experience with EF6 - one other guy tried to make it go, and gave up a lot sooner than I did).
The primary goal of this effort is to obtain a high degree of maintainability and re-use. EF simply doesn't give us anything tangible that meets that goal.
Like I've already said, EF6 is great if you're just working with tables/views, but we don't hit *any* tables directly from our apps - everything goes through stored procs.
As soon as I'm done testing the code, I'll post my DBObject in a tip/trick.
".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
|
|
|
|
|
did u try developer express xpo.https://documentation.devexpress.com/XPO/1998/eXpress-Persistent-Objects..but if your requirement is to let the database engine do the compute with store procedures then thats something else..
Caveat Emptor.
"Progress doesn't come from early risers – progress is made by lazy men looking for easier ways to do things." Lazarus Long
|
|
|
|
|
We don't own a license and the procurement process takes MONTHS, so it's not likely that we'll even explore it.
".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
|
|
|
|
|
there is a trial and samples with full implementation code you can evaluate before you take a decision.. also if you have less business objects to consider then migration would not be so complicated...
Caveat Emptor.
"Progress doesn't come from early risers – progress is made by lazy men looking for easier ways to do things." Lazarus Long
|
|
|
|
|
I am not willing to wait for the 6-9 month procurement cycle to be completed. I have work to do, and trying to learn another ORM product is NOT worth my time.
Beyond that, my self-written code is much faster than any ORM could hope to be. Testing is proceeding at a brisk pace, with only one thing I've had to fix.
".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
|
|
|
|
|
Quote: Beyond that, my self-written code is much faster than any ORM could hope to be
Agree, ORM is for non programmers
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
#realJSOP wrote: We don't own a license and the procurement process takes MONTHS, so it's not likely that we'll even explore it.
Off topic a bit... its seems like every time you post, there's some part of it that shows some dissatisfaction with your job/employer.
You seem really unhappy there. Why not leave for something better? Your job sounds like hell on earth.
Just curious.
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
The job itself isn't bad. I went in knowing what to expect.
Except for this - They're in the process of moving all our apps and tools to the cloud (no more dev tools on our local box).
Irony - they wouldn't let us have internet access from our dev boxes, yet they're going to host all our dev crap on the cloud, which will require internet access.
I can hardly wait for sh*t to go sideways...
".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
|
|
|
|
|
That sounds fun.
Good luck
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
EF isn't that short for...
Elephant?
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
"Extreme F*ckage"
".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
|
|
|
|
|
<snicker> I have a thing called DBops, written in the 90s, probably about 100 lines of code 50% of which are comments. It is probably used in about 20 different organisations by now. Simple, fast and any junior programmer can understand and use it.
I also have an ORM called ClassBuilder which builds the procs based on table and views, wcf models and DAL, WPF models and dataservice basic CRUD code, telerik grid code and dialog code.
You may know stuff but I'm a lazy bastard.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Mycroft Holmes wrote: You may know stuff but I'm a lazy bastard.
You need to note that in your sig so that it becomes common knowledge.
".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
|
|
|
|
|
You can use EF Core with .net framework. In fact, most .net standard libraries can be used in .net core and .net framework, including web app, console, uwp, and library projects.
This means you have access to DI, logging, security, and a host of other great vastly improved .net functionality
"Time flies like an arrow. Fruit flies like a banana."
|
|
|
|
|
At this point, I don't care. Even if we use EF7, there are going to be bugs that are discovered that MS won't fix. They have already demonstrated a propensity for doing just that. No more ORMs for us if I have anything at all to say about it.
".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
|
|
|
|
|
OK, VS2019 is installed, and I loaded a small test project into it - the one I use for checking code before I answer a QA question, as it happens.
And the first thing I notice (once I've got all the windows where they belong, and found where to turn off the line numbers anyway) is that it "suggests" changes: using an expression bodied constructor instead of the older style:
public frmMain()
{
InitializeComponent();
} IS out, and this is in:
public frmMain() => InitializeComponent(); Hmmm ... OK, I can learn to live with that.
Then: "Replace GetWindowsInstallationDateTime with a property":
public static DateTime GetWindowsInstallationDateTime()
{
Microsoft.Win32.RegistryKey key = Microsoft.Win32.RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, Microsoft.Win32.RegistryView.Registry64);
key = key.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion", false);
if (key != null)
{
DateTime startDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
Int64 regVal = Convert.ToInt64(key.GetValue("InstallDate").ToString());
DateTime installDate = startDate.AddSeconds(regVal);
return installDate;
}
return DateTime.MinValue;
}
Is out, this is in:
public static DateTime WindowsInstallationDateTime
{
get
{
Microsoft.Win32.RegistryKey key = Microsoft.Win32.RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, Microsoft.Win32.RegistryView.Registry64);
key = key.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion", false);
if (key != null)
{
DateTime startDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
Int64 regVal = Convert.ToInt64(key.GetValue("InstallDate").ToString());
DateTime installDate = startDate.AddSeconds(regVal);
return installDate;
}
return DateTime.MinValue;
}
}
Hmmm. Less sure about this, but I can see why. Kinda. OK. Do it.
What's next?
Oh, right: "Replace WindowsInstallationDateTime with a method".
Hang on a moment ... you want to replace
public static DateTime WindowsInstallationDateTime
{
get
{
Microsoft.Win32.RegistryKey key = Microsoft.Win32.RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, Microsoft.Win32.RegistryView.Registry64);
key = key.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion", false);
if (key != null)
{
DateTime startDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
Int64 regVal = Convert.ToInt64(key.GetValue("InstallDate").ToString());
DateTime installDate = startDate.AddSeconds(regVal);
return installDate;
}
return DateTime.MinValue;
}
}
With
public static DateTime GetWindowsInstallationDateTime()
{
Microsoft.Win32.RegistryKey key = Microsoft.Win32.RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, Microsoft.Win32.RegistryView.Registry64);
key = key.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion", false);
if (key != null)
{
DateTime startDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
Int64 regVal = Convert.ToInt64(key.GetValue("InstallDate").ToString());
DateTime installDate = startDate.AddSeconds(regVal);
return installDate;
}
return DateTime.MinValue;
}
That's exactly what I started with! This is going to get annoying, isn't it ...
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!
|
|
|
|
|
If I suggest several restaurants, will you try them all? A suggestion that something is possible does not guarantee an improvement. Has been so since the first FxCop
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Depends: if the first one is rubbish, then no.
If the first one is good, I'll probably try the second.
But this is more like the waiter recommending you ignore the menu and go from the specials board, then when he comes back to take the order telling you the specials aren't as good as the regular menu ...
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!
|
|
|
|
|
OriginalGriff wrote: But this is more like the waiter recommending you ignore the menu and go from the specials board, then when he comes back to take the order telling you the specials aren't as good as the regular menu ... If you accept each suggestion, than you will be eathing the special, and after finishing and adding it to the total, you'll be suggested to eat from the regular menu.
Just like there's tools to "extract" a variable to a property, and back.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
AI at it's greatest!!!
"The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge". Stephen Hawking, 1942- 2018
|
|
|
|
|
|
I think it is simply infinite recursion at its best
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Microsoft, putting the artificial in intelligence.
|
|
|
|
|