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
- entityreference_tresulttype.cs
- AcceptorSessionSymmetricTransportSecurityProtocol.cs
- StorageAssociationSetMapping.cs
- OleDbParameter.cs
- RemotingServices.cs
- TraceSection.cs
- ListControl.cs
- QilSortKey.cs
- AutomationPropertyInfo.cs
- complextypematerializer.cs
- StylusTouchDevice.cs
- Application.cs
- UdpAnnouncementEndpoint.cs
- Group.cs
- DataSetUtil.cs
- SqlWorkflowInstanceStore.cs
- PagerSettings.cs
- Image.cs
- CacheVirtualItemsEvent.cs
- ControlHelper.cs
- EnumBuilder.cs
- InvalidProgramException.cs
- ServiceBusyException.cs
- StylusPointPropertyInfoDefaults.cs
- SecurityKeyIdentifier.cs
- LiteralControl.cs
- StringDictionary.cs
- SHA1Managed.cs
- IOThreadTimer.cs
- EncodingNLS.cs
- ParallelSeparator.xaml.cs
- HttpsTransportElement.cs
- Faults.cs
- JsonDataContract.cs
- PictureBox.cs
- TemplatePagerField.cs
- DataObjectMethodAttribute.cs
- SqlDataSource.cs
- SmiXetterAccessMap.cs
- CodePrimitiveExpression.cs
- DbConnectionPoolIdentity.cs
- Util.cs
- MsmqIntegrationMessageProperty.cs
- SqlUserDefinedTypeAttribute.cs
- ChildrenQuery.cs
- IncrementalHitTester.cs
- CommonObjectSecurity.cs
- DiscardableAttribute.cs
- IndexingContentUnit.cs
- EventLogPermissionAttribute.cs
- SendMailErrorEventArgs.cs
- OleTxTransaction.cs
- CodeMemberEvent.cs
- ConnectionConsumerAttribute.cs
- ModelPropertyImpl.cs
- DatagridviewDisplayedBandsData.cs
- NetTcpSecurityElement.cs
- BaseValidator.cs
- StringUtil.cs
- GraphicsPath.cs
- RelationshipEndCollection.cs
- BrowserTree.cs
- XmlDocumentSerializer.cs
- OutputCacheProfileCollection.cs
- AttachedAnnotationChangedEventArgs.cs
- LOSFormatter.cs
- FormatException.cs
- ModulesEntry.cs
- Label.cs
- ParseChildrenAsPropertiesAttribute.cs
- odbcmetadatafactory.cs
- MessageQueueException.cs
- InfoCardKeyedHashAlgorithm.cs
- CroppedBitmap.cs
- WebPartCancelEventArgs.cs
- FtpRequestCacheValidator.cs
- XmlSerializationWriter.cs
- Validator.cs
- TableRow.cs
- DefaultTextStore.cs
- HttpGetServerProtocol.cs
- HashMembershipCondition.cs
- SectionVisual.cs
- SrgsElement.cs
- MessageQueueEnumerator.cs
- JournalNavigationScope.cs
- Compiler.cs
- TdsParser.cs
- SaveCardRequest.cs
- StaticExtension.cs
- SapiInterop.cs
- MetadataCollection.cs
- OutgoingWebRequestContext.cs
- BasicExpandProvider.cs
- TextServicesDisplayAttribute.cs
- ExpressionBuilderCollection.cs
- MediaScriptCommandRoutedEventArgs.cs
- InstanceOwnerException.cs
- GlobalProxySelection.cs
- ModelFunction.cs