Add compatibility with Entity Framework 6