src/Misc/EFTools/EntityDesign/VisualStudio/EdmUtils.cs
// <summary>
//     Gets the target SCHEMA VERSION of the project's installed runtime, or if none,
//     of the latest runtime available on the project's target framework.
// </summary>
Gets the target SCHEMA VERSION of the project's installed runtime, or if none,
of the latest runtime available on the project's target framework.
Gets the target SCHEMA VERSION of the project ' s installed runtime or if none of the latest runtime available on the project ' s target framework .
public static Version GetEntityFrameworkVersion(Project project, IServiceProvider serviceProvider, bool useLatestIfNoEF = true)
        {
            Debug.Assert(project != null, "project != null");
            Debug.Assert(serviceProvider != null, "serviceProvider != null");
            if (VsUtils.IsMiscellaneousProject(project))
            {
                return null;
            }
            var efAssemblyVersion = VsUtils.GetInstalledEntityFrameworkAssemblyVersion(project);
            var netFrameworkVersion = NetFrameworkVersioningHelper.TargetNetFrameworkVersion(project, serviceProvider);
            if (efAssemblyVersion == null
                && !useLatestIfNoEF)
            {
                return RuntimeVersion.GetSchemaVersionForNetFrameworkVersion(netFrameworkVersion);
            }
            return RuntimeVersion.GetTargetSchemaVersion(efAssemblyVersion, netFrameworkVersion);
        }
public static Version GetEntityFrameworkVersion ( Project project , IServiceProvider serviceProvider , bool useLatestIfNoEF = true ) { Debug . Assert ( project != null , " " ) ; Debug . Assert ( serviceProvider != null , " " ) ; if ( VsUtils . IsMiscellaneousProject ( project ) ) { return null ; } var efAssemblyVersion = VsUtils . GetInstalledEntityFrameworkAssemblyVersion ( project ) ; var netFrameworkVersion = NetFrameworkVersioningHelper . TargetNetFrameworkVersion ( project , serviceProvider ) ; if ( efAssemblyVersion == null && ! useLatestIfNoEF ) { return RuntimeVersion . GetSchemaVersionForNetFrameworkVersion ( netFrameworkVersion ) ; } return RuntimeVersion . GetTargetSchemaVersion ( efAssemblyVersion , netFrameworkVersion ) ; }
Gets the target SCHEMA VERSION of the project's installed runtime, or if none,
of the latest runtime available on the project's target framework.
Gets the target SCHEMA VERSION of the project ' s installed runtime or if none of the latest runtime available on the project ' s target framework .
project
Project
serviceProvider
IServiceProvider
useLatestIfNoEF
bool