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
- PassportPrincipal.cs
- EnumerableRowCollectionExtensions.cs
- BinaryParser.cs
- RuntimeIdentifierPropertyAttribute.cs
- ClassDataContract.cs
- EmptyCollection.cs
- HttpValueCollection.cs
- figurelength.cs
- ThreadStateException.cs
- ConnectionConsumerAttribute.cs
- LambdaCompiler.Logical.cs
- HwndMouseInputProvider.cs
- ThousandthOfEmRealPoints.cs
- DataGridViewComboBoxColumn.cs
- SecurityUtils.cs
- MatrixKeyFrameCollection.cs
- Win32PrintDialog.cs
- ItemTypeToolStripMenuItem.cs
- Parameter.cs
- StringValidatorAttribute.cs
- RegexCharClass.cs
- X509SubjectKeyIdentifierClause.cs
- GridEntry.cs
- RangeValuePattern.cs
- BaseTemplateCodeDomTreeGenerator.cs
- TextEditorCopyPaste.cs
- _DomainName.cs
- MsmqHostedTransportConfiguration.cs
- SharedConnectionWorkflowTransactionService.cs
- PointLight.cs
- GroupBoxDesigner.cs
- NumericUpDownAccelerationCollection.cs
- HtmlInputButton.cs
- RSAPKCS1KeyExchangeFormatter.cs
- Accessible.cs
- ItemCheckedEvent.cs
- SafeCoTaskMem.cs
- SamlNameIdentifierClaimResource.cs
- LookupBindingPropertiesAttribute.cs
- WebPartDescriptionCollection.cs
- ExclusiveTcpListener.cs
- WebBrowserNavigatingEventHandler.cs
- HtmlInputFile.cs
- MultiViewDesigner.cs
- ButtonStandardAdapter.cs
- TabRenderer.cs
- OrderByBuilder.cs
- ThicknessConverter.cs
- Scripts.cs
- ItemMap.cs
- SymbolMethod.cs
- XamlInt32CollectionSerializer.cs
- VirtualDirectoryMapping.cs
- MailWebEventProvider.cs
- CodeIdentifiers.cs
- CustomErrorsSection.cs
- BaseUriHelper.cs
- UnsafeNativeMethods.cs
- UIElement.cs
- DocumentPageView.cs
- LockedHandleGlyph.cs
- Accessors.cs
- LabelExpression.cs
- TypeGeneratedEventArgs.cs
- AttachedPropertiesService.cs
- ConfigXmlElement.cs
- StringValueConverter.cs
- SqlNotificationRequest.cs
- UdpTransportSettings.cs
- COM2IProvidePropertyBuilderHandler.cs
- DateTimeValueSerializerContext.cs
- BrowserTree.cs
- KeyboardDevice.cs
- HwndSourceKeyboardInputSite.cs
- WebContext.cs
- InputDevice.cs
- CopyNodeSetAction.cs
- ClaimTypeElement.cs
- ToolStripPanelCell.cs
- OutputBuffer.cs
- CallbackHandler.cs
- Color.cs
- TileBrush.cs
- DataGridViewBand.cs
- ToolStripSplitButton.cs
- RegexBoyerMoore.cs
- UrlMapping.cs
- VoiceChangeEventArgs.cs
- ToolStripItemClickedEventArgs.cs
- Polyline.cs
- InternalsVisibleToAttribute.cs
- BitmapPalettes.cs
- StatusBarPanel.cs
- ImmutableObjectAttribute.cs
- XamlTreeBuilderBamlRecordWriter.cs
- HttpListenerException.cs
- NativeMethods.cs
- XMLUtil.cs
- BulletChrome.cs
- Mouse.cs