Posts

Showing posts from July, 2025

Entity Framework, Let's add some power to it

Image
  Wow Entity Framework is starting to pack Power So, what do I mean by that. It was released 15 years ago on the  11 of August 2008. Back then it was part of the . NET Framework 3.5 Service Pack 1   and you could use it with Visual Studio 2008 as long as you had service pack 1. To be honest, back then it wasn't very good. It was slow and a little painful. Jump forward 15 years... Jump forward 16 years and we now have Entity Framework Core 9. You can add it to you use it .Net 9 as a set of Nuget packages.  This short blog post isn't going to teach you how to use EF Core 9, or .Net 9 it is simply going to show you how to ramp up your retrieval of data. So, why is EF 9 Core so powerful? Say we have a service Method called CreateBankCustomer that accept a complex object that includes BankCustomer and a list of BankBankAccounts? You can create all the table entries in one fail swoop.... using (var context = new BankingContext()) {     var customer = new BankCust...

Extracting Text from a Screenshot Using Tesseract

Image
Tesseract -  https://github.com/charlesw/tesseract  is an open source OCR engine written for .Net. I have been using it for several months to extract text from screenshots I have taken from an app I use for my gig work. This has allowed me to easily create orders in my database and also add tips to the orders. Anyway, this blog is about how to use Tesseract, not how I've used it. So let's get started. Firstly Tesseract isn't the only OCR Engine. I like it because it is open source and works fairly well. Probably the best known is Iron OCR -  https://ironsoftware.com/csharp/ocr . IronOCR requires a  https://ironsoftware.com/csharp/ocr/licensing/ . For enterprise applications with a decent budget I would recomment Iron OCR, but for small projects where you don't have the budget you should be OK using Tesseract. So, let's dive right in. I am going to demonstrate this using a .Net 9 Console App, in Visual Studio. Once you have you console app you need to include some Nu...

I am Me, no excuses, just Me

Image
It all started many years ago when at the age of 10 a neighbor gave me a book on computer programming. I read it and was hooked. I asked him how I could do it and he gave me a stack of punch cards and a punch and told me to go at it, so I did. Back then there were no personal computers, so I had to send my program to IBM to run it. They did and 2 weeks later I got the results, syntax error on card 28. That was when I learnt my first lesson, check your code!!! I was hooked. That was over 40 years ago. I never planned to make computer programming my job, it was my hobby. This was the 70s, I was a warden at a sports complex, ran a mobile disco and played field hockey. All the time I carried on learning to program. By the early 80s small personal computers came out and I got a Sinclair Spectrum. It saved programs and executables to cassette tape and I had 8K of memory. I wrote text-based adventure games which I shared with my friends. This was all good until one of my friend's sister ...

When Greed and Deception Destroy a Company

Image
  Have you ever worked for a company where you thought it was too true to be true? Did they give you free snacks, great coffee, lunch every now and then, send employees on trips? All under the disguise of caring. Then you see the signs that it is actually more about making money. They are unhappy when you would rather take a day off then charge the client for a day when you do no work. They complain if you work in the evening because the code you needed to test wasn't available until then. They get you to secretly test the client's site just because their developers didn't like having to use the client's components. They add more people to the project because they have hours left to use up. All while pushing the harder work down the road.  My question is when did companies become so unethical? They promise the world to their clients then deliver things that are just good enough. I am a very ethical person. I always have been. I believe in doing the work necessary to get...