I’ve been watching the #build2015 conference online for the past couple of days. Microsoft has some nice, compelling product announcements.
One that caught my attention was Application Insights. So, I decided to give it a shot with an existing MVC + WebApi web application.
After, mostly, getting the SSO / OAuth2 server setup with OWIN working over the past week, I ran into a few interesting scenarios and bits of information worth sharing.
The main scenario was in dealing with Authorization Code Grant across different domains and working that scenario into both the SSO paradigm and “protected Resource” server access.
Recently, I had a conversation with another developer about the role of DBA’s in the development process. It was immediately clear that, philosophically, our viewpoints diverged.
The conversation digressed, and I found that this developer was completely against using ORMs to make queries. The term ‘ad-hoc queries’ was bandied about quite a bit. This other developer also went so far as to tell me that, in a code review in ‘hard-core’ dev shops, ad-hoc queries would get smacked down.
One of my biggest areas of struggle is in writing unit tests.
I enjoy all of the mocking frameworks, like Moq and Automoq, but I find that after mocking up so many interfaces, I question whether the unit tests have value.
In my previous post discussing profiling Entity Framework, I alluded to DbInterceptors as being able to provide lots of useful functionality. In this post I’ll expand on the DbInterceptor and show a few optimizations / manipulations that I like to perform on EF’s generated queries.
I’ve really enjoyed running WordPress. However, there are a few features that plugin authors overlook or don’t consider. One such problem that I ran into was with the Social Login plugin that I use.
This is a great plugin (Social Login), but it was not loading profile images over HTTPS. While this may not seem like a big deal, it did make it so that a browser would report an issue with my site. This was a bit of a show stopper for me after the effort I put into getting certs/https/etc set up.
Fortunately, thanks to the flexibility of WordPress, and PHP in general, it wasn’t too terribly hard to fix.
As I’m moving more code that I’ve written in the past to my blog, I remembered I posted this code a long while on CodePaste. It allows you to send an SMS text message via your Google Voice account.
It’s a simple bit of code that’s authenticating via your Google account and then getting the proper auth codes in order to send the text message.
Profiling a ‘black box’ framework to see exactly how it works and behaves can be edifying. It can also lead to better optimizations/usage of the framework. In my case, it helped diminish the mistrust of Entity Framework.
There are tools like Rhinomocks EF Profiler which allow for inspecting the ObjectContext of Entity Framework. However, if you don’t want to buy additional tools, you can effectively write your own.
I’ve used T4MVC within my MVC projects for a long, long time now. It’s one of those extremely useful utilities that probably gets forgotten.
At any rate, I’m not sure if I ever mentioned why I like T4MVC, but here are a few reasons.
Using Stored Procedures in the latest version of Entity Framework is pretty doable. You lose a lot in terms of flexibility, but sometimes there are trade-offs that one must make. This week I was playing around with converting an application that used a Repository pattern with EF, Lambdas, and IQueryables to StoredProcs for all CRUD operations.
Here are some interesting bits that I learned.