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
- ObjectPersistData.cs
- DbParameterCollection.cs
- RequestDescription.cs
- MetadataItemEmitter.cs
- PropertyEmitterBase.cs
- SerializationFieldInfo.cs
- AccessDataSource.cs
- LinearGradientBrush.cs
- ResolvedKeyFrameEntry.cs
- Primitive.cs
- WinFormsSecurity.cs
- SchemaMerger.cs
- LineServices.cs
- EditorAttributeInfo.cs
- CodeIndexerExpression.cs
- Content.cs
- followingsibling.cs
- MissingMethodException.cs
- ImageDrawing.cs
- List.cs
- TraceHandler.cs
- ColumnHeader.cs
- LogAppendAsyncResult.cs
- InternalCache.cs
- Util.cs
- TextEditorContextMenu.cs
- CodeAccessPermission.cs
- DataRowComparer.cs
- WindowsFormsHelpers.cs
- StreamWithDictionary.cs
- ModuleBuilder.cs
- ToolCreatedEventArgs.cs
- Operator.cs
- GeometryValueSerializer.cs
- AccessedThroughPropertyAttribute.cs
- ListenerChannelContext.cs
- HttpFileCollection.cs
- PolyQuadraticBezierSegment.cs
- UDPClient.cs
- ToolStripPanel.cs
- Scheduling.cs
- Icon.cs
- SoapIncludeAttribute.cs
- WebPartMenu.cs
- SetIndexBinder.cs
- RequiredArgumentAttribute.cs
- PersonalizableAttribute.cs
- RotateTransform3D.cs
- SQLDecimalStorage.cs
- EnumerableRowCollectionExtensions.cs
- StreamUpdate.cs
- Typography.cs
- XmlEntity.cs
- Latin1Encoding.cs
- TypeDescriptionProvider.cs
- RangeValuePattern.cs
- SubtreeProcessor.cs
- RelatedCurrencyManager.cs
- GroupItemAutomationPeer.cs
- Pen.cs
- shaper.cs
- CopyOfAction.cs
- MsmqInputChannelListenerBase.cs
- PageThemeParser.cs
- Parser.cs
- BackoffTimeoutHelper.cs
- RegularExpressionValidator.cs
- RSAPKCS1SignatureDeformatter.cs
- NativeCompoundFileAPIs.cs
- MethodBuilder.cs
- LocalizedNameDescriptionPair.cs
- FormViewUpdatedEventArgs.cs
- HopperCache.cs
- MouseGesture.cs
- filewebresponse.cs
- HasCopySemanticsAttribute.cs
- VersionedStreamOwner.cs
- ProviderCommandInfoUtils.cs
- TriggerBase.cs
- HMACSHA256.cs
- SynchronizationContext.cs
- unsafeIndexingFilterStream.cs
- RealizationDrawingContextWalker.cs
- DesignerToolStripControlHost.cs
- Attributes.cs
- XmlSchemaCompilationSettings.cs
- COMException.cs
- ShimAsPublicXamlType.cs
- TempFiles.cs
- Page.cs
- ConstraintManager.cs
- NullableConverter.cs
- TextComposition.cs
- Material.cs
- InstanceValue.cs
- JoinSymbol.cs
- TextFragmentEngine.cs
- RuntimeUtils.cs
- Clock.cs
- XPathItem.cs