Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / DataServiceKeyAttribute.cs / 2 / 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.Generic; 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. 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.Generic; 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. 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
- FileLogRecordStream.cs
- CAGDesigner.cs
- ThrowHelper.cs
- ProfilePropertySettingsCollection.cs
- NetworkStream.cs
- NumericUpDown.cs
- PermissionListSet.cs
- Grant.cs
- DataViewManager.cs
- XslException.cs
- BaseParaClient.cs
- MimeParameterWriter.cs
- counter.cs
- StylusPointPropertyId.cs
- DataBoundLiteralControl.cs
- SharedTcpTransportManager.cs
- HTMLTextWriter.cs
- TaskExceptionHolder.cs
- XmlSchemaAnyAttribute.cs
- DispatcherExceptionEventArgs.cs
- LinkedDataMemberFieldEditor.cs
- TextEffect.cs
- CompensatableSequenceActivity.cs
- DesignerSerializerAttribute.cs
- QueryResponse.cs
- ByteStack.cs
- Style.cs
- VectorCollection.cs
- COAUTHINFO.cs
- Type.cs
- LoginCancelEventArgs.cs
- GenericEnumConverter.cs
- ProfileSettings.cs
- NavigatorOutput.cs
- EmptyElement.cs
- TextTreeUndoUnit.cs
- BindingListCollectionView.cs
- ClientBuildManagerCallback.cs
- TimeSpanStorage.cs
- KeyPullup.cs
- WindowsEditBox.cs
- DataGridViewBand.cs
- Activator.cs
- DynamicControlParameter.cs
- QueryExpr.cs
- SqlAggregateChecker.cs
- ComponentConverter.cs
- KerberosRequestorSecurityToken.cs
- Models.cs
- IsolatedStorageException.cs
- DataTablePropertyDescriptor.cs
- PaperSize.cs
- CryptoHelper.cs
- WebBrowserNavigatingEventHandler.cs
- OracleException.cs
- NamedPipeHostedTransportConfiguration.cs
- JsonClassDataContract.cs
- CompositionTarget.cs
- ResourceAssociationSetEnd.cs
- ServicePointManagerElement.cs
- COM2Properties.cs
- Normalization.cs
- ExtendedPropertyCollection.cs
- FormViewDeleteEventArgs.cs
- SqlCacheDependencyDatabaseCollection.cs
- ImportContext.cs
- TextBoxBase.cs
- Highlights.cs
- ModuleBuilderData.cs
- FileIOPermission.cs
- DoubleLinkList.cs
- EnumMember.cs
- PolyLineSegmentFigureLogic.cs
- LocalizabilityAttribute.cs
- XmlSchemaExporter.cs
- LayoutDump.cs
- StateItem.cs
- RectangleGeometry.cs
- StackOverflowException.cs
- DesignSurfaceManager.cs
- ButtonField.cs
- PositiveTimeSpanValidator.cs
- Native.cs
- SerialPort.cs
- EventLogPermission.cs
- Connector.cs
- TreeNodeSelectionProcessor.cs
- XmlNamespaceDeclarationsAttribute.cs
- RangeValueProviderWrapper.cs
- SyndicationSerializer.cs
- TextTreeRootNode.cs
- ConvertTextFrag.cs
- LogExtentCollection.cs
- ItemDragEvent.cs
- SubMenuStyleCollection.cs
- ADMembershipUser.cs
- IncrementalHitTester.cs
- PropertyTab.cs
- Point.cs
- Substitution.cs