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
- PrintControllerWithStatusDialog.cs
- TextFormattingConverter.cs
- XmlSchemaSimpleTypeList.cs
- DbConnectionClosed.cs
- GifBitmapEncoder.cs
- Rectangle.cs
- ParsedAttributeCollection.cs
- MembershipSection.cs
- loginstatus.cs
- MetaTableHelper.cs
- CodeThrowExceptionStatement.cs
- XmlIncludeAttribute.cs
- NullableIntAverageAggregationOperator.cs
- TextRenderer.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- DropShadowBitmapEffect.cs
- WinEventTracker.cs
- XmlSchemaExporter.cs
- MissingMethodException.cs
- SecurityResources.cs
- CompilerState.cs
- ListViewDeletedEventArgs.cs
- FixedPageAutomationPeer.cs
- MimeFormReflector.cs
- DtdParser.cs
- PageFunction.cs
- MenuStrip.cs
- FrameworkElementFactoryMarkupObject.cs
- WasAdminWrapper.cs
- XmlILAnnotation.cs
- ListSourceHelper.cs
- MergablePropertyAttribute.cs
- StorageFunctionMapping.cs
- RectangleConverter.cs
- HttpRawResponse.cs
- ToggleButton.cs
- WindowsAuthenticationModule.cs
- SafeNativeMethodsOther.cs
- TraceListeners.cs
- IndexOutOfRangeException.cs
- LinqDataSourceDeleteEventArgs.cs
- Pts.cs
- Token.cs
- SafeRightsManagementQueryHandle.cs
- HostVisual.cs
- ImageListUtils.cs
- AssociationSetMetadata.cs
- UidManager.cs
- ResourcesBuildProvider.cs
- InheritanceService.cs
- ThreadStartException.cs
- LinqDataSourceInsertEventArgs.cs
- HttpCapabilitiesSectionHandler.cs
- NotSupportedException.cs
- RequestUriProcessor.cs
- HyperLinkDesigner.cs
- MD5.cs
- PageClientProxyGenerator.cs
- EdmItemError.cs
- GlyphingCache.cs
- ObjectStateManagerMetadata.cs
- WindowProviderWrapper.cs
- BindingManagerDataErrorEventArgs.cs
- NullableLongSumAggregationOperator.cs
- TreeNode.cs
- CatalogPartCollection.cs
- SeekableReadStream.cs
- ProcessProtocolHandler.cs
- XmlQuerySequence.cs
- RemotingSurrogateSelector.cs
- ProfileGroupSettingsCollection.cs
- NumberSubstitution.cs
- Rotation3DAnimationBase.cs
- ZipIOBlockManager.cs
- FilteredDataSetHelper.cs
- XmlReflectionImporter.cs
- TableCellCollection.cs
- Ray3DHitTestResult.cs
- Funcletizer.cs
- BookmarkCallbackWrapper.cs
- PerfCounters.cs
- EdmFunction.cs
- ChunkedMemoryStream.cs
- CodeMemberField.cs
- DynamicActivityXamlReader.cs
- LayoutSettings.cs
- SqlFileStream.cs
- DiscoveryDocumentReference.cs
- RequiredAttributeAttribute.cs
- TextDecorationUnitValidation.cs
- CodeDirectionExpression.cs
- SystemIPv6InterfaceProperties.cs
- TypeSystemProvider.cs
- CroppedBitmap.cs
- SqlStatistics.cs
- DataGridViewRowHeaderCell.cs
- AssertFilter.cs
- SqlDataSourceTableQuery.cs
- OdbcConnectionHandle.cs
- Point4DValueSerializer.cs