Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------------- // // 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
- EventLogEntry.cs
- AdPostCacheSubstitution.cs
- ImageList.cs
- WorkflowMarkupElementEventArgs.cs
- ChtmlFormAdapter.cs
- CompressStream.cs
- PolygonHotSpot.cs
- ReadOnlyDataSourceView.cs
- SHA384.cs
- InterleavedZipPartStream.cs
- SqlProviderManifest.cs
- _LoggingObject.cs
- KnownAssemblyEntry.cs
- Range.cs
- ReachObjectContext.cs
- WindowsListViewItem.cs
- OdbcCommand.cs
- PaginationProgressEventArgs.cs
- IODescriptionAttribute.cs
- XmlILModule.cs
- FormClosingEvent.cs
- AvtEvent.cs
- BuildProviderUtils.cs
- WebConfigurationHostFileChange.cs
- ObjectListCommandCollection.cs
- ListBoxDesigner.cs
- XmlWhitespace.cs
- IPHostEntry.cs
- SplineQuaternionKeyFrame.cs
- XPathDescendantIterator.cs
- SiteMapNodeCollection.cs
- ListViewItem.cs
- _NegotiateClient.cs
- MarkerProperties.cs
- DtcInterfaces.cs
- TabletDeviceInfo.cs
- DashStyle.cs
- smtppermission.cs
- DescendentsWalkerBase.cs
- FileUpload.cs
- LocationChangedEventArgs.cs
- TextEffectCollection.cs
- DelegateInArgument.cs
- ActivityDefaults.cs
- ScrollProperties.cs
- ValidatedControlConverter.cs
- BlurEffect.cs
- ComponentDispatcher.cs
- MultipleViewPatternIdentifiers.cs
- StringBuilder.cs
- XmlCustomFormatter.cs
- CodeAccessSecurityEngine.cs
- HijriCalendar.cs
- SQLChars.cs
- _ProxyRegBlob.cs
- XslAstAnalyzer.cs
- AmbiguousMatchException.cs
- Int64AnimationBase.cs
- WindowsIdentity.cs
- SafeSecurityHelper.cs
- X509CertificateValidationMode.cs
- sqlstateclientmanager.cs
- CultureInfo.cs
- namescope.cs
- FixedHighlight.cs
- SiblingIterators.cs
- IsolationInterop.cs
- XPathAncestorIterator.cs
- SystemWebSectionGroup.cs
- DataGridParentRows.cs
- QueueTransferProtocol.cs
- InvalidOperationException.cs
- IncrementalReadDecoders.cs
- XmlDownloadManager.cs
- RegisteredHiddenField.cs
- InitializationEventAttribute.cs
- Selection.cs
- EventSetter.cs
- XmlChildNodes.cs
- DataGridViewCellStyleEditor.cs
- MaskedTextProvider.cs
- ButtonRenderer.cs
- SchemaRegistration.cs
- WebPartAuthorizationEventArgs.cs
- ColumnMapVisitor.cs
- ExpressionCopier.cs
- CancellationScope.cs
- RemotingException.cs
- GAC.cs
- ResourceDefaultValueAttribute.cs
- EventLogPermissionAttribute.cs
- ValueTypeFixupInfo.cs
- RawStylusInput.cs
- ReadWriteObjectLock.cs
- HttpWebRequest.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- GCHandleCookieTable.cs
- TypeInfo.cs
- MsmqDiagnostics.cs
- MimeWriter.cs