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
- DelimitedListTraceListener.cs
- XmlSchemaComplexType.cs
- WindowsListBox.cs
- DesignTableCollection.cs
- assemblycache.cs
- BackoffTimeoutHelper.cs
- UriParserTemplates.cs
- TableLayoutCellPaintEventArgs.cs
- CodeDomComponentSerializationService.cs
- QueryResponse.cs
- TraceSection.cs
- RepeatButton.cs
- SemaphoreFullException.cs
- ByteAnimationUsingKeyFrames.cs
- RuntimeEnvironment.cs
- XmlDataSourceView.cs
- Light.cs
- MultiAsyncResult.cs
- RegexBoyerMoore.cs
- Context.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- DataRecordInternal.cs
- DataTableTypeConverter.cs
- Geometry.cs
- PageParserFilter.cs
- XPathDocument.cs
- PowerStatus.cs
- LabelTarget.cs
- DocumentGridContextMenu.cs
- HttpHandler.cs
- Themes.cs
- Trigger.cs
- DesignerEventService.cs
- X509WindowsSecurityToken.cs
- FixedDocumentSequencePaginator.cs
- Source.cs
- AnnotationResourceChangedEventArgs.cs
- SubqueryRules.cs
- XmlBinaryReader.cs
- AsyncCompletedEventArgs.cs
- SQLGuid.cs
- Walker.cs
- WaitHandleCannotBeOpenedException.cs
- Literal.cs
- LayoutEngine.cs
- Oci.cs
- DirectoryNotFoundException.cs
- Internal.cs
- UnmanagedMarshal.cs
- XPathNavigatorKeyComparer.cs
- SendActivityDesignerTheme.cs
- TransformGroup.cs
- MetaType.cs
- XPathMessageFilterElement.cs
- ZipIORawDataFileBlock.cs
- FormViewInsertEventArgs.cs
- CodeExporter.cs
- Identity.cs
- ConfigurationSchemaErrors.cs
- SiteMapDataSource.cs
- XmlSchemaAll.cs
- EntityDataSourceState.cs
- DBNull.cs
- TreeSet.cs
- WorkflowPrinting.cs
- UpdateCompiler.cs
- TrackingMemoryStream.cs
- RuntimeArgumentHandle.cs
- SqlWebEventProvider.cs
- GuidTagList.cs
- ThreadSafeList.cs
- TranslateTransform.cs
- SessionPageStatePersister.cs
- MarkupCompilePass1.cs
- UserMapPath.cs
- IsolatedStorageFile.cs
- AssociationTypeEmitter.cs
- XPathNode.cs
- AspNetSynchronizationContext.cs
- AlphaSortedEnumConverter.cs
- Journal.cs
- GeometryModel3D.cs
- WS2007FederationHttpBindingCollectionElement.cs
- KeyManager.cs
- XmlTextReaderImpl.cs
- FieldNameLookup.cs
- AssemblyInfo.cs
- RuntimeResourceSet.cs
- GeometryHitTestParameters.cs
- _SslStream.cs
- hwndwrapper.cs
- DynamicQueryableWrapper.cs
- ApplicationDirectoryMembershipCondition.cs
- IIS7UserPrincipal.cs
- ProcessHostFactoryHelper.cs
- WebZone.cs
- ChangePassword.cs
- HtmlElementErrorEventArgs.cs
- CryptoHelper.cs
- Tile.cs