Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Common / DbProviderManifest.cs / 1305376 / DbProviderManifest.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System.Collections.Generic; using System.Collections.ObjectModel; using System.Data.Metadata.Edm; using System.Xml; namespace System.Data.Common { ////// Metadata Interface for all CLR types types /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db")] public abstract class DbProviderManifest { ////// Constructor /// protected DbProviderManifest() { } ///Value to pass to GetInformation to get the StoreSchemaDefinition public static readonly string StoreSchemaDefinition = "StoreSchemaDefinition"; ///Value to pass to GetInformation to get the StoreSchemaMapping public static readonly string StoreSchemaMapping = "StoreSchemaMapping"; ///Value to pass to GetInformation to get the ConceptualSchemaDefinition public static readonly string ConceptualSchemaDefinition = "ConceptualSchemaDefinition"; // System Facet Info ////// Name of the MaxLength Facet /// internal const string MaxLengthFacetName = "MaxLength"; ////// Name of the Unicode Facet /// internal const string UnicodeFacetName = "Unicode"; ////// Name of the FixedLength Facet /// internal const string FixedLengthFacetName = "FixedLength"; ////// Name of the Precision Facet /// internal const string PrecisionFacetName = "Precision"; ////// Name of the Scale Facet /// internal const string ScaleFacetName = "Scale"; ////// Name of the Nullable Facet /// internal const string NullableFacetName = "Nullable"; ////// Name of the DefaultValue Facet /// internal const string DefaultValueFacetName = "DefaultValue"; ////// Name of the Collation Facet /// internal const string CollationFacetName = "Collation"; ////// Returns the namespace used by this provider manifest /// public abstract string NamespaceName {get;} ////// Return the set of types supported by the store /// ///A collection of primitive types public abstract System.Collections.ObjectModel.ReadOnlyCollectionGetStoreTypes(); /// /// Returns all the edm functions supported by the provider manifest. /// ///A collection of edm functions. public abstract System.Collections.ObjectModel.ReadOnlyCollectionGetStoreFunctions(); /// /// Returns all the FacetDescriptions for a particular type /// /// the type to return FacetDescriptions for ///The FacetDescriptions for the type given [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "edm")] public abstract System.Collections.ObjectModel.ReadOnlyCollectionGetFacetDescriptions(EdmType edmType); /// /// This method allows a provider writer to take a type and a set of facets /// and reason about what the best mapped equivalent type in EDM would be. /// /// A TypeUsage encapsulating a store type and a set of facets ///A TypeUsage encapsulating an EDM type and a set of facets [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Edm")] public abstract TypeUsage GetEdmType(TypeUsage storeType); ////// This method allows a provider writer to take a type and a set of facets /// and reason about what the best mapped equivalent type in the store would be. /// /// A TypeUsage encapsulating an EDM type and a set of facets ///A TypeUsage encapsulating a store type and a set of facets [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "edm")] public abstract TypeUsage GetStoreType(TypeUsage edmType); ////// Providers should override this to return information specific to their provider. /// /// This method should never return null. /// /// The name of the information to be retrieved. ///An XmlReader at the begining of the information requested. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db")] protected abstract XmlReader GetDbInformation(string informationType); ////// Gets framework and provider specific information /// /// This method should never return null. /// /// The name of the information to be retrieved. ///An XmlReader at the begining of the information requested. public XmlReader GetInformation(string informationType) { XmlReader reader = null; try { reader = GetDbInformation(informationType); } catch (Exception e) { // we should not be wrapping all exceptions if (EntityUtil.IsCatchableExceptionType(e)) { // we don't want folks to have to know all the various types of exceptions that can // occur, so we just rethrow a ProviderIncompatibleException and make whatever we caught // the inner exception of it. throw EntityUtil.ProviderIncompatible( System.Data.Entity.Strings.EntityClient_FailedToGetInformation(informationType), e); } throw; } if (reader == null) { // if the provider returned null for the conceptual schema definition, return the default one if (informationType == ConceptualSchemaDefinition) { return DbProviderServices.GetConceptualSchemaDescription(); } throw EntityUtil.ProviderIncompatible(System.Data.Entity.Strings.ProviderReturnedNullForGetDbInformation(informationType)); } return reader; } ////// Does the provider support escaping strings to be used as patterns in a Like expression. /// If the provider overrides this method to return true, /// If the provider supports escaping, the character that would be used /// as the escape character ///should /// also be overridden. /// True, if this provider supports escaping strings to be used as patterns in a Like expression, /// false otherwise. The default implementation returns false. public virtual bool SupportsEscapingLikeArgument(out char escapeCharacter) { escapeCharacter = default(char); return false; } ////// Provider writers should override this method to returns the argument with the wildcards and the escape /// character escaped. This method is only used if /// The argument to be escaped ///returns true. /// The argument with the wildcards and the escape character escaped public virtual string EscapeLikeArgument(string argument) { throw EntityUtil.ProviderIncompatible(System.Data.Entity.Strings.ProviderShouldOverrideEscapeLikeArgument); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System.Collections.Generic; using System.Collections.ObjectModel; using System.Data.Metadata.Edm; using System.Xml; namespace System.Data.Common { ////// Metadata Interface for all CLR types types /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db")] public abstract class DbProviderManifest { ////// Constructor /// protected DbProviderManifest() { } ///Value to pass to GetInformation to get the StoreSchemaDefinition public static readonly string StoreSchemaDefinition = "StoreSchemaDefinition"; ///Value to pass to GetInformation to get the StoreSchemaMapping public static readonly string StoreSchemaMapping = "StoreSchemaMapping"; ///Value to pass to GetInformation to get the ConceptualSchemaDefinition public static readonly string ConceptualSchemaDefinition = "ConceptualSchemaDefinition"; // System Facet Info ////// Name of the MaxLength Facet /// internal const string MaxLengthFacetName = "MaxLength"; ////// Name of the Unicode Facet /// internal const string UnicodeFacetName = "Unicode"; ////// Name of the FixedLength Facet /// internal const string FixedLengthFacetName = "FixedLength"; ////// Name of the Precision Facet /// internal const string PrecisionFacetName = "Precision"; ////// Name of the Scale Facet /// internal const string ScaleFacetName = "Scale"; ////// Name of the Nullable Facet /// internal const string NullableFacetName = "Nullable"; ////// Name of the DefaultValue Facet /// internal const string DefaultValueFacetName = "DefaultValue"; ////// Name of the Collation Facet /// internal const string CollationFacetName = "Collation"; ////// Returns the namespace used by this provider manifest /// public abstract string NamespaceName {get;} ////// Return the set of types supported by the store /// ///A collection of primitive types public abstract System.Collections.ObjectModel.ReadOnlyCollectionGetStoreTypes(); /// /// Returns all the edm functions supported by the provider manifest. /// ///A collection of edm functions. public abstract System.Collections.ObjectModel.ReadOnlyCollectionGetStoreFunctions(); /// /// Returns all the FacetDescriptions for a particular type /// /// the type to return FacetDescriptions for ///The FacetDescriptions for the type given [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "edm")] public abstract System.Collections.ObjectModel.ReadOnlyCollectionGetFacetDescriptions(EdmType edmType); /// /// This method allows a provider writer to take a type and a set of facets /// and reason about what the best mapped equivalent type in EDM would be. /// /// A TypeUsage encapsulating a store type and a set of facets ///A TypeUsage encapsulating an EDM type and a set of facets [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Edm")] public abstract TypeUsage GetEdmType(TypeUsage storeType); ////// This method allows a provider writer to take a type and a set of facets /// and reason about what the best mapped equivalent type in the store would be. /// /// A TypeUsage encapsulating an EDM type and a set of facets ///A TypeUsage encapsulating a store type and a set of facets [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "edm")] public abstract TypeUsage GetStoreType(TypeUsage edmType); ////// Providers should override this to return information specific to their provider. /// /// This method should never return null. /// /// The name of the information to be retrieved. ///An XmlReader at the begining of the information requested. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db")] protected abstract XmlReader GetDbInformation(string informationType); ////// Gets framework and provider specific information /// /// This method should never return null. /// /// The name of the information to be retrieved. ///An XmlReader at the begining of the information requested. public XmlReader GetInformation(string informationType) { XmlReader reader = null; try { reader = GetDbInformation(informationType); } catch (Exception e) { // we should not be wrapping all exceptions if (EntityUtil.IsCatchableExceptionType(e)) { // we don't want folks to have to know all the various types of exceptions that can // occur, so we just rethrow a ProviderIncompatibleException and make whatever we caught // the inner exception of it. throw EntityUtil.ProviderIncompatible( System.Data.Entity.Strings.EntityClient_FailedToGetInformation(informationType), e); } throw; } if (reader == null) { // if the provider returned null for the conceptual schema definition, return the default one if (informationType == ConceptualSchemaDefinition) { return DbProviderServices.GetConceptualSchemaDescription(); } throw EntityUtil.ProviderIncompatible(System.Data.Entity.Strings.ProviderReturnedNullForGetDbInformation(informationType)); } return reader; } ////// Does the provider support escaping strings to be used as patterns in a Like expression. /// If the provider overrides this method to return true, /// If the provider supports escaping, the character that would be used /// as the escape character ///should /// also be overridden. /// True, if this provider supports escaping strings to be used as patterns in a Like expression, /// false otherwise. The default implementation returns false. public virtual bool SupportsEscapingLikeArgument(out char escapeCharacter) { escapeCharacter = default(char); return false; } ////// Provider writers should override this method to returns the argument with the wildcards and the escape /// character escaped. This method is only used if /// The argument to be escaped ///returns true. /// The argument with the wildcards and the escape character escaped public virtual string EscapeLikeArgument(string argument) { throw EntityUtil.ProviderIncompatible(System.Data.Entity.Strings.ProviderShouldOverrideEscapeLikeArgument); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TreeNodeConverter.cs
- SerializationStore.cs
- EditorPart.cs
- SystemDiagnosticsSection.cs
- ReadOnlyCollection.cs
- Missing.cs
- DataDocumentXPathNavigator.cs
- __Filters.cs
- MetadataSource.cs
- HtmlLinkAdapter.cs
- CheckedListBox.cs
- Keywords.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- Html32TextWriter.cs
- _Semaphore.cs
- AncillaryOps.cs
- DependencyObjectPropertyDescriptor.cs
- DesignerActionUI.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- RawUIStateInputReport.cs
- VarInfo.cs
- StorageMappingFragment.cs
- NodeLabelEditEvent.cs
- RadioButtonDesigner.cs
- DataControlImageButton.cs
- ParseHttpDate.cs
- SqlProcedureAttribute.cs
- UnaryExpressionHelper.cs
- Codec.cs
- ColorComboBox.cs
- XmlSchemaSubstitutionGroup.cs
- EntityUtil.cs
- PermissionAttributes.cs
- MetafileHeaderWmf.cs
- SchemaImporterExtension.cs
- HttpResponseBase.cs
- ITreeGenerator.cs
- SecurityState.cs
- FixedPageStructure.cs
- PrePostDescendentsWalker.cs
- ResourceReferenceExpressionConverter.cs
- PagesChangedEventArgs.cs
- DataSetUtil.cs
- OleDbEnumerator.cs
- DataServiceEntityAttribute.cs
- SmtpLoginAuthenticationModule.cs
- TextSelection.cs
- GiveFeedbackEvent.cs
- DetailsViewCommandEventArgs.cs
- ITextView.cs
- PolygonHotSpot.cs
- InvalidWorkflowException.cs
- WorkflowPageSetupDialog.cs
- CodePageUtils.cs
- NumberSubstitution.cs
- OperationAbortedException.cs
- DataGridViewCellCancelEventArgs.cs
- BookmarkUndoUnit.cs
- Assert.cs
- ImageDesigner.cs
- BlurBitmapEffect.cs
- SchemaType.cs
- XmlDictionaryString.cs
- ImageSource.cs
- PrintControllerWithStatusDialog.cs
- XmlDataSourceNodeDescriptor.cs
- TextEditorMouse.cs
- EdmConstants.cs
- MsmqIntegrationSecurity.cs
- Lease.cs
- KnownTypesProvider.cs
- WebPartCancelEventArgs.cs
- NotFiniteNumberException.cs
- ExtendLockAsyncResult.cs
- DeviceContext2.cs
- TemplatedWizardStep.cs
- SQLStringStorage.cs
- ExpressionValueEditor.cs
- DynamicFilterExpression.cs
- BitmapEffectDrawingContextState.cs
- ObjectStateFormatter.cs
- UrlMappingCollection.cs
- exports.cs
- Compilation.cs
- RequestCacheEntry.cs
- ArrayListCollectionBase.cs
- ImageFormatConverter.cs
- ScriptServiceAttribute.cs
- NestedContainer.cs
- RelOps.cs
- Effect.cs
- TrackBarRenderer.cs
- LineBreak.cs
- precedingsibling.cs
- XmlBufferReader.cs
- Fonts.cs
- DataGridViewColumn.cs
- SoapEnumAttribute.cs
- MasterPageBuildProvider.cs
- __TransparentProxy.cs