Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / DataServiceKeyAttribute.cs / 1 / 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
- EdmFunction.cs
- BindValidationContext.cs
- GeometryDrawing.cs
- SQLDecimalStorage.cs
- DecimalAnimation.cs
- UInt16Converter.cs
- ContractAdapter.cs
- BinaryWriter.cs
- WindowsButton.cs
- SyndicationSerializer.cs
- BindingListCollectionView.cs
- DragEventArgs.cs
- WorkflowStateRollbackService.cs
- ToolBarPanel.cs
- ToolStripActionList.cs
- COM2ComponentEditor.cs
- OverlappedAsyncResult.cs
- ReturnType.cs
- FontUnit.cs
- BehaviorDragDropEventArgs.cs
- ValueHandle.cs
- WorkflowServiceAttributes.cs
- SqlDataSourceCache.cs
- MeasureItemEvent.cs
- ButtonRenderer.cs
- VirtualPathUtility.cs
- NonBatchDirectoryCompiler.cs
- BulletedList.cs
- HiddenField.cs
- CodeComment.cs
- DataServiceClientException.cs
- isolationinterop.cs
- GridViewRowPresenter.cs
- RenderCapability.cs
- CompatibleComparer.cs
- ProxyOperationRuntime.cs
- XmlUtil.cs
- wgx_sdk_version.cs
- DatagramAdapter.cs
- CompensateDesigner.cs
- DayRenderEvent.cs
- SudsParser.cs
- EnumUnknown.cs
- SelectionProcessor.cs
- BookmarkScopeHandle.cs
- EmbeddedMailObjectsCollection.cs
- tabpagecollectioneditor.cs
- ExpressionNode.cs
- KeyGestureValueSerializer.cs
- WebAdminConfigurationHelper.cs
- HttpCapabilitiesSectionHandler.cs
- DiscoveryDocumentSerializer.cs
- QilReference.cs
- DockAndAnchorLayout.cs
- RandomDelaySendsAsyncResult.cs
- SemaphoreFullException.cs
- RoutingUtilities.cs
- AutoGeneratedFieldProperties.cs
- Camera.cs
- DataConnectionHelper.cs
- DefaultValueMapping.cs
- KnownAssemblyEntry.cs
- ToolStripSeparatorRenderEventArgs.cs
- mediapermission.cs
- TerminateDesigner.cs
- VersionedStream.cs
- ProviderCommandInfoUtils.cs
- CultureInfo.cs
- QilInvoke.cs
- WaitHandleCannotBeOpenedException.cs
- _emptywebproxy.cs
- RenderData.cs
- CoTaskMemSafeHandle.cs
- UpWmlPageAdapter.cs
- InkPresenterAutomationPeer.cs
- Ref.cs
- WorkItem.cs
- SocketInformation.cs
- ErrorHandler.cs
- ToolBar.cs
- DependencyPropertyConverter.cs
- SchemaCollectionCompiler.cs
- ToolStripDropDownItem.cs
- PerformanceCounterPermission.cs
- HMACMD5.cs
- XmlSequenceWriter.cs
- LiteralText.cs
- GenerateTemporaryTargetAssembly.cs
- TimestampInformation.cs
- dtdvalidator.cs
- XmlSerializationGeneratedCode.cs
- QilUnary.cs
- PeerTransportListenAddressValidator.cs
- BindingCollection.cs
- MatrixTransform.cs
- TraceSwitch.cs
- KeyProperty.cs
- AndCondition.cs
- ListViewItemSelectionChangedEvent.cs
- ApplicationId.cs