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
- XmlWriterDelegator.cs
- AssemblyLoader.cs
- Schema.cs
- OleDbCommandBuilder.cs
- Tokenizer.cs
- WindowsSlider.cs
- PageStatePersister.cs
- FlowDocumentPage.cs
- Exception.cs
- DesignTimeParseData.cs
- TextTreePropertyUndoUnit.cs
- ContentHostHelper.cs
- InfoCardArgumentException.cs
- ControlType.cs
- StylusDownEventArgs.cs
- DataViewSetting.cs
- ResourcePermissionBase.cs
- Utils.cs
- TableCell.cs
- BrowserCapabilitiesCompiler.cs
- LoggedException.cs
- OdbcConnectionString.cs
- HttpModuleAction.cs
- LockedActivityGlyph.cs
- EditingContext.cs
- XmlNamespaceManager.cs
- MouseEvent.cs
- SHA512CryptoServiceProvider.cs
- DesignerUtils.cs
- Interlocked.cs
- VisualStateChangedEventArgs.cs
- ContractBase.cs
- ConfigurationStrings.cs
- UiaCoreProviderApi.cs
- sapiproxy.cs
- Transform3DGroup.cs
- PersonalizationStateInfo.cs
- VariableReference.cs
- StrokeDescriptor.cs
- FileVersionInfo.cs
- WorkflowDebuggerSteppingAttribute.cs
- CatalogPartCollection.cs
- ScrollBar.cs
- RemotingHelper.cs
- Line.cs
- SoapSchemaMember.cs
- DataViewListener.cs
- RequestUriProcessor.cs
- PeerInvitationResponse.cs
- DataKey.cs
- FontStretch.cs
- XmlCollation.cs
- ClientSettingsStore.cs
- baseshape.cs
- TabletDevice.cs
- CryptoApi.cs
- SHA384.cs
- ObjectPropertyMapping.cs
- WorkflowMarkupSerializer.cs
- AssociativeAggregationOperator.cs
- ImageList.cs
- AttributeSetAction.cs
- ToolStripContainer.cs
- TransformedBitmap.cs
- ProviderCollection.cs
- CopyAttributesAction.cs
- Attributes.cs
- ISFClipboardData.cs
- SectionInformation.cs
- StyleSheetRefUrlEditor.cs
- ObjectListCommandsPage.cs
- Track.cs
- _ChunkParse.cs
- DbParameterCollectionHelper.cs
- XmlSchemaAttribute.cs
- ApplicationTrust.cs
- ProviderConnectionPoint.cs
- ExceptionRoutedEventArgs.cs
- ControlPaint.cs
- AesCryptoServiceProvider.cs
- MergeFilterQuery.cs
- HttpHandlerActionCollection.cs
- XmlSerializerFactory.cs
- ServiceBusyException.cs
- HttpServerUtilityBase.cs
- FacetDescription.cs
- MetadataCache.cs
- BrowserCapabilitiesCompiler.cs
- TextServicesCompartment.cs
- BrowserCapabilitiesFactory35.cs
- TargetException.cs
- Codec.cs
- MenuItem.cs
- ProfilePropertyNameValidator.cs
- FontFamilyValueSerializer.cs
- ExtensionQuery.cs
- CodeSubDirectoriesCollection.cs
- CompiledRegexRunner.cs
- _UncName.cs
- QilUnary.cs