public override TypeUsage GetEdmType(TypeUsage storeTypeUsage)
        {
            Debug.Assert(storeTypeUsage != null, "storeTypeUsage != null");
            Debug.Assert(storeTypeUsage.EdmType.BuiltInTypeKind == BuiltInTypeKind.PrimitiveType, "Primitive type expected.");
            Debug.Assert(storeTypeUsage.EdmType.GetDataSpace() == DataSpace.SSpace, "Expected SSpace type.");

            try
            {
                var legacyEdmTypeUsage =
                    _wrappedProviderManifest.GetEdmType(storeTypeUsage.ToLegacyStoreTypeUsage(_legacyStoreTypes));

                return(ConvertFromLegacyEdmTypeUsage(legacyEdmTypeUsage));
            }
            catch (SystemData.ProviderIncompatibleException exception)
            {
                throw new ProviderIncompatibleException(exception.Message, exception.InnerException);
            }
        }
Exemplo n.º 2
0
        public void GetEdmType_returns_correct_default_type_usages_for_all_primitive_types()
        {
            var storeTypes = ProviderManifestWrapper.GetStoreTypes().ToDictionary(t => t.Name, t => t);

            foreach (var legacyStoreType in LegacyProviderManifest.GetStoreTypes())
            {
                TypeUsageVerificationHelper.VerifyTypeUsagesEquivalent(
                    LegacyProviderManifest.GetEdmType(LegacyMetadata.TypeUsage.CreateDefaultTypeUsage(legacyStoreType)),
                    ProviderManifestWrapper.GetEdmType(TypeUsage.CreateDefaultTypeUsage(storeTypes[legacyStoreType.Name])));
            }
        }