Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataWeb / Server / System / Data / Services / SingleResultAttribute.cs / 1 / SingleResultAttribute.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Provides a class to decorate custom service operations with
// a single-result attribute.
//
//
// @owner [....]
//---------------------------------------------------------------------
namespace System.Data.Services
{
using System;
using System.Diagnostics;
using System.Reflection;
///
/// Use this attribute on a DataService service operation method
/// to indicate than the IQueryable returned should contain a single element.
///
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public sealed class SingleResultAttribute : Attribute
{
/// Declares a new instance.
public SingleResultAttribute()
{
}
/// Checks whether the specified method has a SingleResultAttribute declared on it.
/// Method to check.
///
/// true if the specified method (in its declared type or in an
/// ancestor declaring the type) has the SingleResultAttribute set.
///
internal static bool MethodHasSingleResult(MethodInfo method)
{
Debug.Assert(method != null, "method != null");
return method.GetCustomAttributes(typeof(SingleResultAttribute), true).Length > 0;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Provides a class to decorate custom service operations with
// a single-result attribute.
//
//
// @owner [....]
//---------------------------------------------------------------------
namespace System.Data.Services
{
using System;
using System.Diagnostics;
using System.Reflection;
///
/// Use this attribute on a DataService service operation method
/// to indicate than the IQueryable returned should contain a single element.
///
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public sealed class SingleResultAttribute : Attribute
{
/// Declares a new instance.
public SingleResultAttribute()
{
}
/// Checks whether the specified method has a SingleResultAttribute declared on it.
/// Method to check.
///
/// true if the specified method (in its declared type or in an
/// ancestor declaring the type) has the SingleResultAttribute set.
///
internal static bool MethodHasSingleResult(MethodInfo method)
{
Debug.Assert(method != null, "method != null");
return method.GetCustomAttributes(typeof(SingleResultAttribute), true).Length > 0;
}
}
}
// 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
- Shape.cs
- AttributeUsageAttribute.cs
- CodeDefaultValueExpression.cs
- KeyboardDevice.cs
- DataGridViewCellPaintingEventArgs.cs
- MethodRental.cs
- SourceInterpreter.cs
- ProtectedConfiguration.cs
- TraceSection.cs
- DataListCommandEventArgs.cs
- IndependentlyAnimatedPropertyMetadata.cs
- AppDomainUnloadedException.cs
- Package.cs
- UpdateRecord.cs
- IndexerNameAttribute.cs
- CompilationUtil.cs
- SupportsEventValidationAttribute.cs
- ManagementDateTime.cs
- OSFeature.cs
- TimelineGroup.cs
- WebBrowserContainer.cs
- ExtensionDataReader.cs
- HtmlTableRow.cs
- TextRangeSerialization.cs
- SqlMetaData.cs
- ScriptResourceHandler.cs
- WorkflowRuntimeElement.cs
- XmlNavigatorStack.cs
- CombinedGeometry.cs
- SqlRetyper.cs
- HashCryptoHandle.cs
- ISAPIWorkerRequest.cs
- BridgeDataReader.cs
- EntityViewContainer.cs
- XsdBuildProvider.cs
- ThreadPool.cs
- GACIdentityPermission.cs
- ReflectionPermission.cs
- Comparer.cs
- XmlSchemaType.cs
- controlskin.cs
- X509Chain.cs
- WebUtil.cs
- SingleSelectRootGridEntry.cs
- TaiwanLunisolarCalendar.cs
- BitmapEffectGeneralTransform.cs
- XmlQueryTypeFactory.cs
- UriTemplateDispatchFormatter.cs
- CompensationDesigner.cs
- Int64KeyFrameCollection.cs
- VirtualizedItemProviderWrapper.cs
- CallbackHandler.cs
- ConnectionPoolManager.cs
- CodeTypeOfExpression.cs
- NameValueCollection.cs
- EntityContainerEmitter.cs
- DataSetUtil.cs
- ToolboxCategory.cs
- DynamicAttribute.cs
- IntegerValidatorAttribute.cs
- FreezableOperations.cs
- HostingEnvironment.cs
- DropDownButton.cs
- PeerNameRecord.cs
- PassportAuthenticationEventArgs.cs
- Composition.cs
- SingleStorage.cs
- GridViewDeleteEventArgs.cs
- RepeatBehavior.cs
- DetailsViewInsertEventArgs.cs
- Marshal.cs
- EntityDataSourceEntitySetNameItem.cs
- HtmlCommandAdapter.cs
- DesignOnlyAttribute.cs
- PowerStatus.cs
- GradientStopCollection.cs
- CustomAttribute.cs
- SubclassTypeValidatorAttribute.cs
- _StreamFramer.cs
- XPathPatternBuilder.cs
- HttpBrowserCapabilitiesBase.cs
- WebContentFormatHelper.cs
- PointCollectionConverter.cs
- EmissiveMaterial.cs
- DataGridViewTopLeftHeaderCell.cs
- RowCache.cs
- ListenerElementsCollection.cs
- WindowsAuthenticationEventArgs.cs
- WindowsSlider.cs
- XmlSerializerNamespaces.cs
- SoapEnvelopeProcessingElement.cs
- ObjectNavigationPropertyMapping.cs
- RenderingBiasValidation.cs
- JavaScriptObjectDeserializer.cs
- TextEffect.cs
- DomainUpDown.cs
- CodeGenerator.cs
- SizeConverter.cs
- XmlDomTextWriter.cs
- CommentEmitter.cs