src/Misc/EFTools/EntityDesign/VisualStudio/RuntimeVersion.cs
// <summary>
//     Whether the given <paramref name="schemaVersion" /> is the latest version supported by the given
//     Entity Framework (i.e. EntityFramework.dll or System.Data.Entity.dll) <paramref name="assemblyVersion" />
// </summary>
// <param name="schemaVersion">Version of the EF schema.</param>
// <param name="assemblyVersion">
//     Version of an Entity Framework (i.e. EntityFramework.dll or System.Data.Entity.dll) assembly.
// </param>
// <param name="targetNetFrameworkVersion">
//     Targeted .NET Framework version. Used to distinguish EF5 from EF4 if the assembly version if 4.0.0.0.
// </param>
// <returns>
//     <c>True</c> if the given <paramref name="schemaVersion" /> is the latest version supported by the given
//     Entity Framework (i.e. EntityFramework.dll or System.Data.Entity.dll) <paramref name="assemblyVersion" />.
//     <c>False</c> otherwise.
// </returns>
Whether the given  is the latest version supported by the given
Entity Framework
Whether the given is the latest version supported by the given Entity Framework
public static bool IsSchemaVersionLatestForAssemblyVersion(
            Version schemaVersion, Version assemblyVersion, Version targetNetFrameworkVersion)
        {
            Debug.Assert(EntityFrameworkVersion.IsValidVersion(schemaVersion), "Invalid schema version");
            Debug.Assert(assemblyVersion != null, "assemblyVersion != null");
            if (assemblyVersion == Version4
                && targetNetFrameworkVersion >= NetFrameworkVersioningHelper.NetFrameworkVersion4_5)
            {
                assemblyVersion = Version5Net45;
            }
            return
                (schemaVersion == EntityFrameworkVersion.Version3 && assemblyVersion >= Version5Net45) ||
                (schemaVersion == EntityFrameworkVersion.Version2 && (assemblyVersion >= Version4 && assemblyVersion <= Version5Net40)) ||
                (schemaVersion == EntityFrameworkVersion.Version1 && assemblyVersion == Version1);
        }
public static bool IsSchemaVersionLatestForAssemblyVersion ( Version schemaVersion , Version assemblyVersion , Version targetNetFrameworkVersion ) { Debug . Assert ( EntityFrameworkVersion . IsValidVersion ( schemaVersion ) , " " ) ; Debug . Assert ( assemblyVersion != null , " " ) ; if ( assemblyVersion == Version4 && targetNetFrameworkVersion >= NetFrameworkVersioningHelper . NetFrameworkVersion4_5 ) { assemblyVersion = Version5Net45 ; } return ( schemaVersion == EntityFrameworkVersion . Version3 && assemblyVersion >= Version5Net45 ) || ( schemaVersion == EntityFrameworkVersion . Version2 && ( assemblyVersion >= Version4 && assemblyVersion <= Version5Net40 ) ) || ( schemaVersion == EntityFrameworkVersion . Version1 && assemblyVersion == Version1 ) ; }
Whether the given  is the latest version supported by the given
Entity Framework (i.e.
Whether the given is the latest version supported by the given Entity Framework ( i . e .
True is the latest version supported by the given
Entity Framework  .
False
True is the latest version supported by the given Entity Framework . False
schemaVersion
Version
Version of the EF schema.
Version of the EF schema .
assemblyVersion
Version
Version of an Entity Framework  assembly.
Version of an Entity Framework assembly .
targetNetFrameworkVersion
Version
Targeted .NET Framework version. Used to distinguish EF5 from EF4 if the assembly version if 4.0.0.0.
Targeted . NET Framework version . Used to distinguish EF5 from EF4 if the assembly version if 4 . 0 . 0 . 0 .