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 public SingleResultAttribute() { } ///instance. 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 public SingleResultAttribute() { } ///instance. 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
- ConfigXmlDocument.cs
- XmlSerializerOperationGenerator.cs
- Point3DAnimation.cs
- PackageStore.cs
- NetStream.cs
- ContainerAction.cs
- HttpResponseWrapper.cs
- OuterGlowBitmapEffect.cs
- BulletedList.cs
- ReferentialConstraint.cs
- OleCmdHelper.cs
- ArrangedElement.cs
- AssertSection.cs
- TargetParameterCountException.cs
- TraceContextRecord.cs
- LostFocusEventManager.cs
- AddressAlreadyInUseException.cs
- TreeViewItem.cs
- SchemaObjectWriter.cs
- ItemChangedEventArgs.cs
- _WinHttpWebProxyDataBuilder.cs
- GridViewColumnHeader.cs
- FamilyMapCollection.cs
- DoubleLink.cs
- DataContractSerializerServiceBehavior.cs
- FontUnit.cs
- HScrollProperties.cs
- Quaternion.cs
- MobilePage.cs
- NameObjectCollectionBase.cs
- Win32Native.cs
- OdbcConnectionPoolProviderInfo.cs
- DataTableTypeConverter.cs
- DataViewManager.cs
- InstancePersistenceContext.cs
- Evidence.cs
- ExtensionDataObject.cs
- SystemColors.cs
- log.cs
- ProxyFragment.cs
- TextRangeBase.cs
- ItemsPresenter.cs
- TypeBrowser.xaml.cs
- RTTrackingProfile.cs
- RangeValidator.cs
- BaseDataBoundControl.cs
- DataServiceKeyAttribute.cs
- DataGridViewCheckBoxCell.cs
- XamlFilter.cs
- ConsumerConnectionPoint.cs
- FormView.cs
- ChannelTerminatedException.cs
- CustomAttributeSerializer.cs
- DataObjectPastingEventArgs.cs
- PropertyToken.cs
- ActivityMarkupSerializationProvider.cs
- ToolBarOverflowPanel.cs
- ObjectStateEntryDbDataRecord.cs
- EntityContainerEntitySetDefiningQuery.cs
- ChannelFactoryRefCache.cs
- SecurityRuntime.cs
- PerspectiveCamera.cs
- Application.cs
- shaperfactoryquerycachekey.cs
- SqlConnectionString.cs
- ExpandoObject.cs
- EditorResources.cs
- SerializationInfoEnumerator.cs
- PreloadedPackages.cs
- QueueProcessor.cs
- ObjectConverter.cs
- CDSsyncETWBCLProvider.cs
- SqlCrossApplyToCrossJoin.cs
- HttpStreamXmlDictionaryReader.cs
- RSAPKCS1KeyExchangeFormatter.cs
- ValidatedControlConverter.cs
- Triplet.cs
- TextReturnReader.cs
- Animatable.cs
- Int64.cs
- DeclarativeCatalogPart.cs
- RootBrowserWindowProxy.cs
- ScaleTransform3D.cs
- InputBinding.cs
- RichTextBoxDesigner.cs
- FlowDocumentPage.cs
- relpropertyhelper.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- DependencyProperty.cs
- XPathNodeList.cs
- CodeStatement.cs
- Config.cs
- RectangleConverter.cs
- WpfGeneratedKnownProperties.cs
- FormattedTextSymbols.cs
- HttpsChannelFactory.cs
- EntityClientCacheKey.cs
- CompoundFileReference.cs
- PersonalizationStateInfoCollection.cs
- DocobjHost.cs