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
- WorkflowApplicationTerminatedException.cs
- DynamicFilterExpression.cs
- PeerNameRecord.cs
- MetadataResolver.cs
- TextElementCollection.cs
- Utils.cs
- InputMethod.cs
- WS2007FederationHttpBindingElement.cs
- ToolStripItemImageRenderEventArgs.cs
- SerializationBinder.cs
- TaskFormBase.cs
- NetworkInformationException.cs
- Decorator.cs
- DesignerEventService.cs
- WebPartHeaderCloseVerb.cs
- BreakRecordTable.cs
- sqlnorm.cs
- ButtonBase.cs
- XmlSerializerVersionAttribute.cs
- Utils.cs
- SystemIcmpV4Statistics.cs
- MessageLoggingElement.cs
- FixedPageAutomationPeer.cs
- ConfigurationPermission.cs
- RelationshipEndCollection.cs
- StringSource.cs
- SerialReceived.cs
- FieldMetadata.cs
- GenericTypeParameterBuilder.cs
- AmbientLight.cs
- BackgroundWorker.cs
- DockPattern.cs
- DockPanel.cs
- unsafenativemethodsother.cs
- shaperfactoryquerycachekey.cs
- RowUpdatedEventArgs.cs
- StorageMappingItemLoader.cs
- HebrewCalendar.cs
- RadioButtonStandardAdapter.cs
- BufferedReadStream.cs
- TimeIntervalCollection.cs
- Highlights.cs
- Nodes.cs
- DateTimeSerializationSection.cs
- BufferedReadStream.cs
- ADRoleFactoryConfiguration.cs
- DesignBinding.cs
- InvalidFilterCriteriaException.cs
- FrameworkContentElement.cs
- Formatter.cs
- View.cs
- DataKey.cs
- AdornerHitTestResult.cs
- ValueUtilsSmi.cs
- SortQuery.cs
- Block.cs
- KerberosTicketHashIdentifierClause.cs
- BrowserCapabilitiesCodeGenerator.cs
- SqlMethods.cs
- DoubleLink.cs
- FormatVersion.cs
- Transform3DGroup.cs
- DesignTableCollection.cs
- PropertyChangingEventArgs.cs
- HttpCacheParams.cs
- Range.cs
- WebPartManagerInternals.cs
- VirtualDirectoryMappingCollection.cs
- DataMemberConverter.cs
- ActivityExecutionFilter.cs
- OperandQuery.cs
- LayoutManager.cs
- UnsafeNativeMethodsPenimc.cs
- ContextBase.cs
- TraceUtility.cs
- RecognizedAudio.cs
- Accessible.cs
- XmlDocumentType.cs
- IconHelper.cs
- MetadataArtifactLoaderCompositeFile.cs
- SqlHelper.cs
- MetadataArtifactLoaderComposite.cs
- StringSorter.cs
- Renderer.cs
- PresentationAppDomainManager.cs
- Cursors.cs
- XmlMapping.cs
- KeyEventArgs.cs
- RegisteredDisposeScript.cs
- XPathNodeList.cs
- FloaterBaseParagraph.cs
- UTF32Encoding.cs
- Transform3D.cs
- ColumnClickEvent.cs
- basenumberconverter.cs
- RootBuilder.cs
- ClientScriptManagerWrapper.cs
- ProcessModelInfo.cs
- ProfileBuildProvider.cs
- LocationReferenceValue.cs