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
- StreamGeometry.cs
- odbcmetadatacolumnnames.cs
- TimeSpanOrInfiniteConverter.cs
- Binding.cs
- MemoryMappedFile.cs
- SessionEndedEventArgs.cs
- Serializer.cs
- ParallelTimeline.cs
- XmlDataCollection.cs
- MaterialGroup.cs
- ErrorWrapper.cs
- Activity.cs
- StorageEntitySetMapping.cs
- DataObjectFieldAttribute.cs
- SqlXml.cs
- LazyTextWriterCreator.cs
- ResourcePermissionBase.cs
- InterleavedZipPartStream.cs
- AnnotationHighlightLayer.cs
- ByteRangeDownloader.cs
- NotifyIcon.cs
- MbpInfo.cs
- StrongNamePublicKeyBlob.cs
- ConnectionManagementElementCollection.cs
- GridViewItemAutomationPeer.cs
- Rect3D.cs
- SqlHelper.cs
- SqlDataSourceStatusEventArgs.cs
- BamlTreeNode.cs
- VisualCollection.cs
- MetadataItemCollectionFactory.cs
- WebPartCloseVerb.cs
- Interlocked.cs
- SplashScreen.cs
- DynamicQueryableWrapper.cs
- MultiAsyncResult.cs
- StaticContext.cs
- WebPartHeaderCloseVerb.cs
- RightsManagementResourceHelper.cs
- StringBuilder.cs
- SamlAction.cs
- XmlSchemaSequence.cs
- Rights.cs
- GatewayDefinition.cs
- DbConnectionPoolGroupProviderInfo.cs
- APCustomTypeDescriptor.cs
- WebBrowserHelper.cs
- HScrollBar.cs
- ScrollBarAutomationPeer.cs
- InkCanvasSelection.cs
- PropertyDescriptorCollection.cs
- KeyGestureValueSerializer.cs
- IgnorePropertiesAttribute.cs
- DateBoldEvent.cs
- ProfileInfo.cs
- BoolExpressionVisitors.cs
- System.Data.OracleClient_BID.cs
- Signature.cs
- WindowsGraphicsWrapper.cs
- ContentElementAutomationPeer.cs
- MethodAccessException.cs
- PrintEvent.cs
- ChameleonKey.cs
- XmlHelper.cs
- ZipQueryOperator.cs
- ZoneIdentityPermission.cs
- StrokeNode.cs
- SiteMapDataSource.cs
- TableLayout.cs
- PersonalizableTypeEntry.cs
- TextDecorationUnitValidation.cs
- InternalConfigSettingsFactory.cs
- UserPersonalizationStateInfo.cs
- Help.cs
- AnnotationService.cs
- DbXmlEnabledProviderManifest.cs
- DataSourceControlBuilder.cs
- DomainUpDown.cs
- ConsoleTraceListener.cs
- Header.cs
- ImageMapEventArgs.cs
- LockRecoveryTask.cs
- ButtonAutomationPeer.cs
- WorkItem.cs
- Table.cs
- SubMenuStyleCollection.cs
- TableItemPattern.cs
- GroupBoxRenderer.cs
- FactoryMaker.cs
- NavigatorOutput.cs
- PropertyItem.cs
- PropertyChangingEventArgs.cs
- SerializationObjectManager.cs
- XmlNodeChangedEventArgs.cs
- JsonReader.cs
- StorageScalarPropertyMapping.cs
- ConnectionsZoneAutoFormat.cs
- ModelProperty.cs
- SpellerStatusTable.cs
- DelegateSerializationHolder.cs