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
- DateTimePicker.cs
- FamilyMapCollection.cs
- CmsUtils.cs
- SoapSchemaMember.cs
- _BaseOverlappedAsyncResult.cs
- CancellationTokenSource.cs
- XmlSchemaSimpleContentExtension.cs
- Button.cs
- CheckBox.cs
- FormatterConverter.cs
- HostSecurityManager.cs
- FamilyMapCollection.cs
- SingleConverter.cs
- TraceHandlerErrorFormatter.cs
- securitymgrsite.cs
- ProfilePropertySettingsCollection.cs
- NativeBuffer.cs
- mediaeventargs.cs
- HttpWebResponse.cs
- SqlPersonalizationProvider.cs
- TemplateBindingExtensionConverter.cs
- SqlNotificationRequest.cs
- InheritanceRules.cs
- ToolStripComboBox.cs
- Image.cs
- TextBlockAutomationPeer.cs
- ServiceContractViewControl.cs
- FixedPage.cs
- ComponentRenameEvent.cs
- AliasGenerator.cs
- CustomErrorsSectionWrapper.cs
- ViewCellSlot.cs
- bidPrivateBase.cs
- Process.cs
- Encoding.cs
- PeerPresenceInfo.cs
- HttpListenerException.cs
- MimeXmlReflector.cs
- PackageStore.cs
- LineServices.cs
- InfoCardMasterKey.cs
- WorkflowDefinitionDispenser.cs
- XamlStyleSerializer.cs
- LinqDataView.cs
- sqlstateclientmanager.cs
- OrCondition.cs
- TextChange.cs
- VarRemapper.cs
- EncryptedReference.cs
- XmlElementAttribute.cs
- OneOfTypeConst.cs
- AuthenticationModuleElement.cs
- DescendantBaseQuery.cs
- DomainLiteralReader.cs
- HostingPreferredMapPath.cs
- __Filters.cs
- GridViewRowPresenter.cs
- SendMailErrorEventArgs.cs
- WebControlParameterProxy.cs
- Operator.cs
- CacheSection.cs
- AssemblyAttributesGoHere.cs
- ScrollViewerAutomationPeer.cs
- DocumentXPathNavigator.cs
- RawStylusInputCustomData.cs
- PlatformNotSupportedException.cs
- UInt16Storage.cs
- XmlNavigatorFilter.cs
- SubqueryRules.cs
- Vector3DCollectionConverter.cs
- WebPartChrome.cs
- DesignTimeHTMLTextWriter.cs
- DBBindings.cs
- WebPartsPersonalizationAuthorization.cs
- ObjectStateFormatter.cs
- SrgsText.cs
- BitmapEffectvisualstate.cs
- sortedlist.cs
- TheQuery.cs
- RewritingSimplifier.cs
- DynamicValueConverter.cs
- SHA512.cs
- HandledMouseEvent.cs
- DomainUpDown.cs
- CacheHelper.cs
- ResXFileRef.cs
- MetadataImporterQuotas.cs
- PathNode.cs
- GetPageCompletedEventArgs.cs
- GetIsBrowserClientRequest.cs
- WindowsFormsHelpers.cs
- MatrixAnimationBase.cs
- AttributeData.cs
- ReadOnlyDictionary.cs
- ItemsChangedEventArgs.cs
- Task.cs
- ObjectMemberMapping.cs
- Int32Converter.cs
- DrawingImage.cs
- IPEndPointCollection.cs