Hacks for EntityFramework6 (https://entityframework.codeplex.com/)