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
- TextServicesDisplayAttributePropertyRanges.cs
- DocumentAutomationPeer.cs
- JsonWriter.cs
- WebPartConnectionsCloseVerb.cs
- ViewPort3D.cs
- DataSetUtil.cs
- FloaterParaClient.cs
- DataRowCollection.cs
- CheckBoxField.cs
- InvalidTimeZoneException.cs
- DateTimeOffset.cs
- MouseGesture.cs
- IItemContainerGenerator.cs
- PropertyGrid.cs
- HttpApplicationFactory.cs
- shaper.cs
- MsmqIntegrationProcessProtocolHandler.cs
- AliasedExpr.cs
- Misc.cs
- util.cs
- TextDecorationCollectionConverter.cs
- Int16.cs
- KeyFrames.cs
- MenuAdapter.cs
- LostFocusEventManager.cs
- StorageEndPropertyMapping.cs
- HttpListenerException.cs
- DataGridViewRowCancelEventArgs.cs
- InkCollectionBehavior.cs
- AutoResizedEvent.cs
- ListItemParagraph.cs
- Help.cs
- TreeViewItemAutomationPeer.cs
- MatrixStack.cs
- ToolBar.cs
- DataGridAutoGeneratingColumnEventArgs.cs
- DataGridLinkButton.cs
- GraphicsPathIterator.cs
- CompositeControl.cs
- DialogResultConverter.cs
- NullableFloatAverageAggregationOperator.cs
- DynamicILGenerator.cs
- BatchStream.cs
- EventDescriptor.cs
- WinFormsSpinner.cs
- InvariantComparer.cs
- MachineKeySection.cs
- DeflateEmulationStream.cs
- Repeater.cs
- GregorianCalendar.cs
- OutputWindow.cs
- WebPartEditVerb.cs
- ItemDragEvent.cs
- TextProperties.cs
- DataGridViewRowCancelEventArgs.cs
- ProfileSection.cs
- IconConverter.cs
- SystemEvents.cs
- MemoryMappedFileSecurity.cs
- XmlAttributeHolder.cs
- ProfessionalColorTable.cs
- EnumerableCollectionView.cs
- SmtpSection.cs
- COM2ComponentEditor.cs
- PrincipalPermission.cs
- FormViewModeEventArgs.cs
- ColumnReorderedEventArgs.cs
- AppDomainInfo.cs
- CriticalHandle.cs
- VerificationException.cs
- XmlDataImplementation.cs
- RawStylusInputCustomDataList.cs
- UnmanagedMemoryStreamWrapper.cs
- GridViewRowCollection.cs
- FilterEventArgs.cs
- _UriTypeConverter.cs
- DesignerWidgets.cs
- StringValidator.cs
- ComponentChangingEvent.cs
- CaseExpr.cs
- DataGridPagerStyle.cs
- GlyphingCache.cs
- HttpModuleCollection.cs
- ItemCollection.cs
- Light.cs
- FindCriteriaElement.cs
- SerialPinChanges.cs
- Memoizer.cs
- GeneralTransform3D.cs
- CustomWebEventKey.cs
- XPathDocumentBuilder.cs
- DefaultWorkflowTransactionService.cs
- MasterPageParser.cs
- UDPClient.cs
- AbandonedMutexException.cs
- _CookieModule.cs
- Dynamic.cs
- UIElementParaClient.cs
- WindowShowOrOpenTracker.cs
- DataGridViewCellCancelEventArgs.cs