Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntityDesign / Design / System / Data / Entity / Design / PluralizationService / EntityDesignPluralizationHandler.cs / 1305376 / EntityDesignPluralizationHandler.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; using System.Globalization; using System.Data.Entity.Design.PluralizationServices; using System.Data.Metadata.Edm; using System.IO; using System.Data.Entity.Design.SsdlGenerator; using System.Data.Entity.Design.Common; using System.Diagnostics; namespace System.Data.Entity.Design { internal class EntityDesignPluralizationHandler { ////// user might set the service to null, so we have to check the null when using this property /// internal PluralizationService Service { get; set; } ////// Handler for pluralization service in Entity Design /// /// overall switch for the service, the service only start working when the value is true /// /// internal EntityDesignPluralizationHandler(PluralizationService service) { this.Service = service; } internal string GetEntityTypeName(string storeTableName) { return this.Service != null ? this.Service.Singularize(storeTableName) : storeTableName; } internal string GetEntitySetName(string storeTableName) { return this.Service != null ? this.Service.Pluralize(storeTableName) : storeTableName; } internal string GetNavigationPropertyName(AssociationEndMember toEnd, string storeTableName) { if (this.Service != null) { return toEnd.RelationshipMultiplicity == RelationshipMultiplicity.Many ? this.Service.Pluralize(storeTableName) : this.Service.Singularize(storeTableName); } else { return storeTableName; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; using System.Globalization; using System.Data.Entity.Design.PluralizationServices; using System.Data.Metadata.Edm; using System.IO; using System.Data.Entity.Design.SsdlGenerator; using System.Data.Entity.Design.Common; using System.Diagnostics; namespace System.Data.Entity.Design { internal class EntityDesignPluralizationHandler { ////// user might set the service to null, so we have to check the null when using this property /// internal PluralizationService Service { get; set; } ////// Handler for pluralization service in Entity Design /// /// overall switch for the service, the service only start working when the value is true /// /// internal EntityDesignPluralizationHandler(PluralizationService service) { this.Service = service; } internal string GetEntityTypeName(string storeTableName) { return this.Service != null ? this.Service.Singularize(storeTableName) : storeTableName; } internal string GetEntitySetName(string storeTableName) { return this.Service != null ? this.Service.Pluralize(storeTableName) : storeTableName; } internal string GetNavigationPropertyName(AssociationEndMember toEnd, string storeTableName) { if (this.Service != null) { return toEnd.RelationshipMultiplicity == RelationshipMultiplicity.Many ? this.Service.Pluralize(storeTableName) : this.Service.Singularize(storeTableName); } else { return storeTableName; } } } } // 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
- StatementContext.cs
- SuppressMessageAttribute.cs
- _FixedSizeReader.cs
- FormsAuthenticationConfiguration.cs
- UserNamePasswordValidator.cs
- ClientSideProviderDescription.cs
- xmlformatgeneratorstatics.cs
- CompilerError.cs
- ResXResourceReader.cs
- Parallel.cs
- PolyQuadraticBezierSegment.cs
- EntityDataSourceWrapperCollection.cs
- SelectedDatesCollection.cs
- TextParagraphView.cs
- DBPropSet.cs
- CollectionView.cs
- SecurityTokenInclusionMode.cs
- Configuration.cs
- XsltContext.cs
- DesignOnlyAttribute.cs
- GPPOINT.cs
- MsmqQueue.cs
- WebPartDescription.cs
- Border.cs
- FieldNameLookup.cs
- DurableTimerExtension.cs
- AudioFileOut.cs
- SecurityManager.cs
- CallTemplateAction.cs
- InvalidCastException.cs
- OutputCache.cs
- EventProvider.cs
- ValidationErrorCollection.cs
- StringConverter.cs
- RoutedEvent.cs
- BindStream.cs
- CollectionChangeEventArgs.cs
- Path.cs
- EnumerationRangeValidationUtil.cs
- MaskedTextProvider.cs
- Site.cs
- AuthenticateEventArgs.cs
- AutomationIdentifier.cs
- HostedNamedPipeTransportManager.cs
- OleDbEnumerator.cs
- SmiMetaData.cs
- Enum.cs
- PerformanceCounterLib.cs
- AsyncCodeActivity.cs
- FillErrorEventArgs.cs
- HotCommands.cs
- DesignerToolStripControlHost.cs
- TileBrush.cs
- TypeEnumerableViewSchema.cs
- EditorPart.cs
- Font.cs
- UIPermission.cs
- GregorianCalendar.cs
- DbQueryCommandTree.cs
- RegexFCD.cs
- ProfileManager.cs
- PresentationTraceSources.cs
- ConsoleCancelEventArgs.cs
- TaskFactory.cs
- SystemWebSectionGroup.cs
- ELinqQueryState.cs
- Emitter.cs
- Hash.cs
- QuestionEventArgs.cs
- indexingfiltermarshaler.cs
- MessageDecoder.cs
- GroupAggregateExpr.cs
- NativeObjectSecurity.cs
- TransactionManager.cs
- XmlDictionary.cs
- DropSourceBehavior.cs
- TransformerTypeCollection.cs
- MetafileHeaderWmf.cs
- DesignerActionTextItem.cs
- RuntimeHelpers.cs
- ReadOnlyDictionary.cs
- HostingEnvironment.cs
- TextChange.cs
- TriggerCollection.cs
- hwndwrapper.cs
- TextParagraphCache.cs
- MouseGesture.cs
- MessageDecoder.cs
- WebMessageEncoderFactory.cs
- RequestCachingSection.cs
- DesignerActionVerbList.cs
- TaskFileService.cs
- MappingModelBuildProvider.cs
- HeaderedItemsControl.cs
- ConnectionConsumerAttribute.cs
- FontDialog.cs
- InstanceStore.cs
- XamlToRtfParser.cs
- LabelAutomationPeer.cs
- ResourceReferenceKeyNotFoundException.cs