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 ReadOnlyCollection keyNames;
///
/// 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 ReadOnlyCollection KeyNames
{
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 ReadOnlyCollection keyNames;
///
/// 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 ReadOnlyCollection KeyNames
{
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
- _SslStream.cs
- EntityDataSourceDataSelection.cs
- TypeSystem.cs
- XmlSchemaFacet.cs
- CustomErrorsSection.cs
- ToggleButton.cs
- KerberosSecurityTokenAuthenticator.cs
- AnimatedTypeHelpers.cs
- ReturnType.cs
- LinkedResourceCollection.cs
- InheritedPropertyDescriptor.cs
- BinaryMethodMessage.cs
- DispatchChannelSink.cs
- AuthenticationModulesSection.cs
- HttpHandlerActionCollection.cs
- UserControlDocumentDesigner.cs
- BatchServiceHost.cs
- TagMapCollection.cs
- BezierSegment.cs
- xmlNames.cs
- XmlILStorageConverter.cs
- UrlMappingCollection.cs
- ContentFileHelper.cs
- TypefaceMetricsCache.cs
- RuleSetBrowserDialog.cs
- ListSourceHelper.cs
- httpserverutility.cs
- HMACSHA1.cs
- AutoGeneratedField.cs
- WhitespaceRule.cs
- BindingMemberInfo.cs
- Crc32Helper.cs
- CodeIdentifier.cs
- DBConcurrencyException.cs
- xmlfixedPageInfo.cs
- TemplateBindingExpressionConverter.cs
- TreeNodeStyleCollection.cs
- Models.cs
- OrthographicCamera.cs
- Int16AnimationUsingKeyFrames.cs
- SaveFileDialog.cs
- FtpWebResponse.cs
- WebPartExportVerb.cs
- FillErrorEventArgs.cs
- PhonemeConverter.cs
- ActiveXContainer.cs
- WebPartCatalogAddVerb.cs
- VirtualPathProvider.cs
- UInt64Converter.cs
- ArrayListCollectionBase.cs
- CustomAttributeBuilder.cs
- DoubleAnimationUsingKeyFrames.cs
- EnumConverter.cs
- RectAnimationUsingKeyFrames.cs
- UrlMappingsModule.cs
- FileDialog_Vista_Interop.cs
- Missing.cs
- SymDocumentType.cs
- TextTreeFixupNode.cs
- CompositeDataBoundControl.cs
- MorphHelper.cs
- AvTraceFormat.cs
- ButtonBase.cs
- Viewport3DAutomationPeer.cs
- EventDescriptor.cs
- TypeForwardedToAttribute.cs
- Triplet.cs
- Rotation3DKeyFrameCollection.cs
- followingquery.cs
- SaveFileDialogDesigner.cs
- ConfigXmlAttribute.cs
- ExpandableObjectConverter.cs
- FastEncoderWindow.cs
- TextTreeRootTextBlock.cs
- DataFormat.cs
- AuthenticationModuleElementCollection.cs
- LocalizableAttribute.cs
- DecoderFallback.cs
- ReflectEventDescriptor.cs
- EmptyControlCollection.cs
- IgnoreDeviceFilterElementCollection.cs
- Bidi.cs
- XsdBuildProvider.cs
- SequenceDesigner.cs
- SystemBrushes.cs
- AddInPipelineAttributes.cs
- DispatcherObject.cs
- XmlSchemaCollection.cs
- OleDbCommandBuilder.cs
- GregorianCalendar.cs
- EventLogQuery.cs
- PkcsUtils.cs
- GB18030Encoding.cs
- ListBoxItemAutomationPeer.cs
- SchemaNamespaceManager.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- MD5HashHelper.cs
- AuthenticationModulesSection.cs
- MetadataProperty.cs
- HttpInputStream.cs