Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- DesignerVerb.cs
- TaiwanLunisolarCalendar.cs
- BlockCollection.cs
- EntityConnectionStringBuilderItem.cs
- ProcessProtocolHandler.cs
- QueryTaskGroupState.cs
- ContentControl.cs
- EncryptedXml.cs
- XmlFormatWriterGenerator.cs
- EncryptionUtility.cs
- BooleanProjectedSlot.cs
- RelationalExpressions.cs
- WebPartCatalogCloseVerb.cs
- Parameter.cs
- PreservationFileReader.cs
- GPPOINT.cs
- SafeFileMapViewHandle.cs
- DataControlField.cs
- ObjectDataSourceChooseTypePanel.cs
- GenericArgumentsUpdater.cs
- PkcsMisc.cs
- DataGridItemEventArgs.cs
- ValueType.cs
- BypassElement.cs
- ComPlusSynchronizationContext.cs
- ArrayWithOffset.cs
- CookieHandler.cs
- MouseGestureValueSerializer.cs
- PropertyGeneratedEventArgs.cs
- OperationCanceledException.cs
- ToolStripItemRenderEventArgs.cs
- GuidConverter.cs
- TdsParserStateObject.cs
- Html32TextWriter.cs
- SimpleRecyclingCache.cs
- IgnoreFileBuildProvider.cs
- ProjectedWrapper.cs
- NameObjectCollectionBase.cs
- Point3DCollectionConverter.cs
- PropertyItemInternal.cs
- XmlAttribute.cs
- Command.cs
- Debug.cs
- TraceLevelStore.cs
- AppliedDeviceFiltersEditor.cs
- MetadataFile.cs
- WorkflowIdleBehavior.cs
- PlainXmlDeserializer.cs
- EditorPartCollection.cs
- GridEntryCollection.cs
- Rect.cs
- Error.cs
- ConvertEvent.cs
- DllNotFoundException.cs
- Span.cs
- BroadcastEventHelper.cs
- TaiwanCalendar.cs
- PipelineComponent.cs
- ObjectDataSourceMethodEventArgs.cs
- SecurityCriticalDataForSet.cs
- SqlWriter.cs
- HttpPostedFileBase.cs
- Point3DAnimation.cs
- DeclarationUpdate.cs
- X509CertificateEndpointIdentity.cs
- TemplateFactory.cs
- XamlInt32CollectionSerializer.cs
- OleServicesContext.cs
- MarkupExtensionSerializer.cs
- LoadedOrUnloadedOperation.cs
- TextParagraphView.cs
- UserPersonalizationStateInfo.cs
- AppModelKnownContentFactory.cs
- MarkupProperty.cs
- jithelpers.cs
- ClassicBorderDecorator.cs
- TrustSection.cs
- MergePropertyDescriptor.cs
- ImportContext.cs
- UnsafeNativeMethodsCLR.cs
- IdentityHolder.cs
- RC2.cs
- DoubleKeyFrameCollection.cs
- MessageQueuePermissionEntryCollection.cs
- PerformanceCounterLib.cs
- ConfigurationManagerHelper.cs
- RichTextBox.cs
- DataGridItem.cs
- PreservationFileReader.cs
- RectangleGeometry.cs
- WebPartTransformerCollection.cs
- ActivityXRefPropertyEditor.cs
- SizeAnimation.cs
- XmlArrayItemAttribute.cs
- ListParagraph.cs
- HtmlHead.cs
- InstanceOwnerException.cs
- WebPartEditorOkVerb.cs
- List.cs
- Binding.cs