Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / DataServiceKeyAttribute.cs / 1 / 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
- CanExecuteRoutedEventArgs.cs
- AttachedAnnotation.cs
- RecordsAffectedEventArgs.cs
- Page.cs
- CompilerTypeWithParams.cs
- ListBoxItem.cs
- ExceptionValidationRule.cs
- BitmapCodecInfo.cs
- SchemaCollectionCompiler.cs
- SqlUserDefinedTypeAttribute.cs
- StateBag.cs
- DataGridViewColumnHeaderCell.cs
- StyleHelper.cs
- ObjectListComponentEditor.cs
- SqlDataSourceCache.cs
- WsiProfilesElement.cs
- StreamGeometry.cs
- TypedTableBaseExtensions.cs
- Evaluator.cs
- NetworkInformationPermission.cs
- TextTrailingCharacterEllipsis.cs
- SafeThemeHandle.cs
- AssemblyNameUtility.cs
- ExpandButtonVisibilityConverter.cs
- PartitionedDataSource.cs
- sqlpipe.cs
- MULTI_QI.cs
- WebControlsSection.cs
- ColorDialog.cs
- RectIndependentAnimationStorage.cs
- XmlAnyElementAttribute.cs
- querybuilder.cs
- Int64Storage.cs
- RoleManagerSection.cs
- XmlDataImplementation.cs
- SendKeys.cs
- DeviceContext2.cs
- CompilerParameters.cs
- WsiProfilesElementCollection.cs
- HashAlgorithm.cs
- UriSection.cs
- PropertyTabChangedEvent.cs
- ContractBase.cs
- TraceContext.cs
- CredentialCache.cs
- DiscoveryReferences.cs
- OdbcEnvironment.cs
- PersonalizationStateInfo.cs
- ToolStripItemEventArgs.cs
- WorkflowViewElement.cs
- DataGridHeadersVisibilityToVisibilityConverter.cs
- ParagraphResult.cs
- ProfileManager.cs
- InternalRelationshipCollection.cs
- DataSourceConverter.cs
- DataGridViewColumnConverter.cs
- DelegateTypeInfo.cs
- FixedSOMImage.cs
- X509Chain.cs
- WindowInteropHelper.cs
- InvalidateEvent.cs
- WrappedReader.cs
- GridViewDeleteEventArgs.cs
- DLinqTableProvider.cs
- WebServiceEnumData.cs
- BufferedMessageData.cs
- FaultImportOptions.cs
- MetadataSource.cs
- GroupDescription.cs
- UpdateProgress.cs
- SchemaMapping.cs
- ListControlDataBindingHandler.cs
- ProbeMatchesMessage11.cs
- DescriptionAttribute.cs
- WhitespaceReader.cs
- HandlerBase.cs
- unsafenativemethodstextservices.cs
- XmlQueryRuntime.cs
- HttpFileCollection.cs
- QueryGeneratorBase.cs
- CellQuery.cs
- HttpValueCollection.cs
- CustomPopupPlacement.cs
- StoreUtilities.cs
- HtmlValidatorAdapter.cs
- CustomAttributeSerializer.cs
- PartitionResolver.cs
- GenericPrincipal.cs
- BaseCodeDomTreeGenerator.cs
- CookielessHelper.cs
- FixedSOMLineCollection.cs
- DuplicateDetector.cs
- XmlQueryCardinality.cs
- ColumnCollection.cs
- SafeFindHandle.cs
- WindowShowOrOpenTracker.cs
- GC.cs
- MimeTypeMapper.cs
- EventPrivateKey.cs
- Int64Converter.cs