Tough MVC 5 OWIN External Authentication Issue

Finally managed to solve a weird issue with external Google authentication in a new MVC 5 application I am working on (CrowdBacklog). This is to help me remember what to do and hopefully help others fix their issues if they stumble upon it… The Scenario VS2013 update 2 Brand new MVC 5 project targeting .Net 4.5.1 – no old MVC4 / Web Forms crud messing things up Startup.Auth.cs has been updated with Google clientid and […] Read more »

Mocking a LINQ Queryable Repository for TDD

Using ORM frameworks like Entity Framework and NHibernate has become standard practice for many developers. POCO using Entity Framework also supports test-driven-development nicely since we can create tests for our business domain objects without having a dependency on the repository used to store them. Entity Framework also supports LINQ queries which allows us to avoid defining every conceivable query necessary for our application ahead of time, instead letting the code that uses the domain objects construct a […] Read more »

6 Steps To Get Entity Framework 5 Working with MySql 5.5

After much battling with configuration and such I have finally managed to get EF5 Code First and MySql 5 working together using the Oracle/MySql .NET Connector 6.5.4 or the official Connector version 6.6.4. This configuration does not currently support Migrations. The steps are as follows: Grab EF 5 from NuGet Grab MySql.Data and MySql.Data.Entity from NuGet (6.5.4) or MySql (6.6.4) Configure a MySql Data Provider Configure a MySql Connection String Create a Custom MySql Database […] Read more »

Generic repository interface for entity framework 4

Huy Nguyen has a great write up on implementing a generic repository interface that supports Entity Framework 4. His code is written in C# and today I had to rewrite it in VB.Net. The VB.Net version looks like this Public Interface IRepository Inherits IDisposable Function GetQuery(Of TEntity As Class)As IQueryable(Of TEntity) Function GetAll(Of TEntity As Class)() As IEnumerable(Of TEntity) Function Find(Of TEntity As Class)(predicate As Expression(Of Func(Of TEntity, Boolean))) As IEnumerable(Of TEntity) Function [Single](Of TEntity […] Read more »

ASP.NET DropDownList always fires SelectedIndexChanged

After a couple of days trying to get to grips with a misbehaving custom compositecontrol I finally located the issue to a feature/bug in the framework implementation of DropDownList and ListControls in general. There is an issue logged on Microsoft Connect but it has been closed as “by-design”. I don’t think that this behavior really is by-design but there are two contradicting features interacting with each other leaving Microsoft with no other choice but to […] Read more »

Break-down of javascript mobile frameworks for phonegap development

I am experimenting with PhoneGap for a couple of projects that I am currently working on. PhoneGap is a native mobile app packager which basically converts a html5/js based site into an app that will run on mobile phones and can be distributed via app store/market. Since PhoneGap merely leverages existing support for html5 and javscript in the mobile phone you have pretty much the same issues as when developing a regular mobile enabled web […] Read more »

Don’t Base64 encode things that users should enter

Base64 encoding is great for converting binary data into a string representation which can be transported over text based protocols like soap or json. Unfortunately Base64 uses a character set which is difficult for humans to interpret so for any data that needs to be human interpretable, like binary representations added to urls, base64 can be a real problem. Douglas Crockford solved this issue years ago with his special Base32 encoding scheme which uses a […] Read more »