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
- DataGridViewRowHeaderCell.cs
- UserCancellationException.cs
- Pkcs7Recipient.cs
- SortAction.cs
- ObjectAssociationEndMapping.cs
- DefaultAssemblyResolver.cs
- SmtpDigestAuthenticationModule.cs
- SmtpSection.cs
- InputProcessorProfiles.cs
- TemplateApplicationHelper.cs
- TrustManager.cs
- Image.cs
- FileNotFoundException.cs
- GAC.cs
- OperationCanceledException.cs
- DocumentViewerBaseAutomationPeer.cs
- Size.cs
- Size.cs
- Zone.cs
- UnsafeNativeMethodsTablet.cs
- Query.cs
- wmiprovider.cs
- FilteredReadOnlyMetadataCollection.cs
- _SSPISessionCache.cs
- ListBindableAttribute.cs
- SqlExpressionNullability.cs
- IriParsingElement.cs
- SimpleWebHandlerParser.cs
- DrawingContextDrawingContextWalker.cs
- XhtmlConformanceSection.cs
- LayeredChannelFactory.cs
- TrackingLocation.cs
- PngBitmapEncoder.cs
- MenuBindingsEditor.cs
- CombinedGeometry.cs
- EntitySqlQueryCacheEntry.cs
- FlowDocumentPaginator.cs
- DiagnosticsConfigurationHandler.cs
- DefaultMemberAttribute.cs
- XmlConvert.cs
- ExeConfigurationFileMap.cs
- BitmapEffectState.cs
- DotExpr.cs
- Root.cs
- SQLInt32.cs
- OpacityConverter.cs
- Relationship.cs
- SchemaEntity.cs
- Native.cs
- Propagator.Evaluator.cs
- XmlReturnWriter.cs
- IISUnsafeMethods.cs
- UserCancellationException.cs
- Vector3D.cs
- SourceChangedEventArgs.cs
- RadioButtonRenderer.cs
- IncrementalReadDecoders.cs
- EditorAttribute.cs
- ByteStreamMessageUtility.cs
- ConfigurationStrings.cs
- GenericEnumerator.cs
- Bits.cs
- XmlElementCollection.cs
- TemplateBaseAction.cs
- UIPropertyMetadata.cs
- UIntPtr.cs
- InvokeHandlers.cs
- shaperfactoryquerycacheentry.cs
- ElementHostAutomationPeer.cs
- EventItfInfo.cs
- HorizontalAlignConverter.cs
- Automation.cs
- GridLengthConverter.cs
- SQLUtility.cs
- Literal.cs
- TiffBitmapDecoder.cs
- FrameAutomationPeer.cs
- UnsafeNativeMethods.cs
- AuthenticatingEventArgs.cs
- RuntimeIdentifierPropertyAttribute.cs
- Selection.cs
- TemplateLookupAction.cs
- CharKeyFrameCollection.cs
- QueryLifecycle.cs
- ResourceReferenceExpression.cs
- WindowPattern.cs
- AppDomainInfo.cs
- SiteMapDataSource.cs
- IdentityReference.cs
- CodeDesigner.cs
- InputLanguageEventArgs.cs
- QueryExtender.cs
- TextWriterEngine.cs
- DataGridViewDataErrorEventArgs.cs
- ObjectIDGenerator.cs
- SqlCachedBuffer.cs
- StrokeCollectionDefaultValueFactory.cs
- RightsManagementEncryptionTransform.cs
- DataGridCommandEventArgs.cs
- EmptyWithCancelationCheckWorkItem.cs