Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / DataServiceKeyAttribute.cs / 1305376 / DataServiceKeyAttribute.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Clr Attribute to be annotated on key properties // // // @owner [....], [....] //--------------------------------------------------------------------- namespace System.Data.Services.Common { using System; using System.Collections.ObjectModel; using System.Data.Services.Client; using System.Linq; ////// Attribute to be annotated on key properties /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1019:DefineAccessorsForAttributeArguments", Justification = "Accessors are available for processed input.")] [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] public sealed class DataServiceKeyAttribute : System.Attribute { ///Name of the properties that form the key. private readonly ReadOnlyCollectionkeyNames; /// /// Initializes a new instance of DataServiceKey attribute with the property name /// that forms the Key. /// /// Name of the property that form the key for the current type. public DataServiceKeyAttribute(string keyName) { Util.CheckArgumentNull(keyName, "keyName"); Util.CheckArgumentNotEmpty(keyName, "KeyName"); this.keyNames = new ReadOnlyCollection(new string[1] { keyName }); } /// /// Initializes a new instance of DataServiceKey attribute with the list of property names /// that form the key. /// /// Name of the properties that form the key for the current type. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "parameters are validated against null via CheckArgumentNull")] public DataServiceKeyAttribute(params string[] keyNames) { Util.CheckArgumentNull(keyNames, "keyNames"); if (keyNames.Length == 0 || keyNames.Any(f => f == null || f.Length == 0)) { throw Error.Argument(Strings.DSKAttribute_MustSpecifyAtleastOnePropertyName, "keyNames"); } this.keyNames = new ReadOnlyCollection(keyNames); } /// Name of the properties that form the key for the current type. public ReadOnlyCollectionKeyNames { get { return this.keyNames; } } } } // 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
- XPathNodeIterator.cs
- KeyFrames.cs
- MethodCallTranslator.cs
- SingleAnimation.cs
- PagesChangedEventArgs.cs
- ContainerControl.cs
- JsonEnumDataContract.cs
- SQLStringStorage.cs
- InternalMappingException.cs
- TabControlCancelEvent.cs
- ServiceMetadataPublishingElement.cs
- TerminatorSinks.cs
- DataGridTextBox.cs
- AutoGeneratedFieldProperties.cs
- MetadataWorkspace.cs
- ContentValidator.cs
- CodeCompileUnit.cs
- DesignerTextViewAdapter.cs
- InvokeMethodActivityDesigner.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- XmlQueryTypeFactory.cs
- SqlCacheDependencyDatabaseCollection.cs
- ItemsControl.cs
- CompilationUnit.cs
- GridItemCollection.cs
- WindowsProgressbar.cs
- TextElementAutomationPeer.cs
- WasEndpointConfigContainer.cs
- NavigateEvent.cs
- PersistenceTypeAttribute.cs
- XmlTypeMapping.cs
- LabelEditEvent.cs
- DbConnectionHelper.cs
- RowUpdatedEventArgs.cs
- PublisherMembershipCondition.cs
- ObjectMaterializedEventArgs.cs
- OrderingQueryOperator.cs
- TabItemAutomationPeer.cs
- XmlBaseWriter.cs
- ListViewAutomationPeer.cs
- AliasExpr.cs
- CachedPathData.cs
- DefaultPropertiesToSend.cs
- Relationship.cs
- DBSqlParserTable.cs
- XmlCountingReader.cs
- OdbcCommand.cs
- Divide.cs
- HostingEnvironment.cs
- CompoundFileStreamReference.cs
- DataGrid.cs
- Splitter.cs
- Switch.cs
- DataGridViewRowsRemovedEventArgs.cs
- GrammarBuilderBase.cs
- HandledMouseEvent.cs
- AutomationElement.cs
- Base64Stream.cs
- SQLGuidStorage.cs
- RtfToXamlReader.cs
- Int16AnimationBase.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- IndicShape.cs
- PathBox.cs
- DictionarySectionHandler.cs
- CompModSwitches.cs
- AdornerDecorator.cs
- FontWeight.cs
- ValidationHelper.cs
- DataBoundControlDesigner.cs
- HyperLinkColumn.cs
- autovalidator.cs
- ExplicitDiscriminatorMap.cs
- ProgressBarBrushConverter.cs
- QueryStoreStatusRequest.cs
- VisualTreeUtils.cs
- DrawingVisual.cs
- BaseTemplatedMobileComponentEditor.cs
- AccessedThroughPropertyAttribute.cs
- WebResourceUtil.cs
- TableCellCollection.cs
- CompoundFileIOPermission.cs
- AuthenticationManager.cs
- CompilationRelaxations.cs
- HyperLinkStyle.cs
- DateTimeUtil.cs
- AttachInfo.cs
- ChtmlLinkAdapter.cs
- WebMessageEncodingElement.cs
- Environment.cs
- StringUtil.cs
- DataSourceHelper.cs
- FilterRepeater.cs
- ConstructorNeedsTagAttribute.cs
- FixedSOMImage.cs
- RadialGradientBrush.cs
- TreeViewImageKeyConverter.cs
- FragmentNavigationEventArgs.cs
- IdleTimeoutMonitor.cs
- TextRangeProviderWrapper.cs