Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- StringUtil.cs
- MiniConstructorInfo.cs
- PositiveTimeSpanValidatorAttribute.cs
- DriveNotFoundException.cs
- PropertyValueUIItem.cs
- EntitySetDataBindingList.cs
- CodeBinaryOperatorExpression.cs
- CacheSection.cs
- StickyNote.cs
- AppSettingsReader.cs
- MailSettingsSection.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- DoubleCollectionConverter.cs
- TextTreeObjectNode.cs
- RC2.cs
- ServiceObjectContainer.cs
- DiagnosticTrace.cs
- DataControlCommands.cs
- WorkflowViewStateService.cs
- SignatureDescription.cs
- SoapObjectReader.cs
- Parsers.cs
- CalendarDataBindingHandler.cs
- DecoratedNameAttribute.cs
- PtsCache.cs
- ToolStripGripRenderEventArgs.cs
- ComplexTypeEmitter.cs
- LinearGradientBrush.cs
- TransformValueSerializer.cs
- SQLUtility.cs
- DateTimeValueSerializerContext.cs
- Html32TextWriter.cs
- InvalidCastException.cs
- InternalEnumValidatorAttribute.cs
- XmlIgnoreAttribute.cs
- XPathNode.cs
- ObjectSecurity.cs
- TryCatchDesigner.xaml.cs
- Barrier.cs
- Separator.cs
- PolicyConversionContext.cs
- ContextQuery.cs
- ScrollItemProviderWrapper.cs
- BrushConverter.cs
- XpsFont.cs
- XmlSchemaInferenceException.cs
- DbFunctionCommandTree.cs
- InputMethod.cs
- ImageConverter.cs
- LoginView.cs
- UrlPath.cs
- RegexGroup.cs
- NullableBoolConverter.cs
- DesignerForm.cs
- NoPersistHandle.cs
- ScriptingJsonSerializationSection.cs
- XmlBoundElement.cs
- XmlSchemaType.cs
- DrawingContextWalker.cs
- ServiceProviders.cs
- UserNameSecurityTokenAuthenticator.cs
- PerformanceCountersElement.cs
- HttpHandlerAction.cs
- HttpCachePolicyElement.cs
- CompilerTypeWithParams.cs
- WinEventWrap.cs
- OracleColumn.cs
- FilterElement.cs
- ObjectDataSource.cs
- Win32NamedPipes.cs
- SqlProfileProvider.cs
- DbMetaDataCollectionNames.cs
- LogEntrySerializationException.cs
- ElapsedEventArgs.cs
- GroupItem.cs
- XComponentModel.cs
- RevocationPoint.cs
- _RequestLifetimeSetter.cs
- RectConverter.cs
- HttpException.cs
- Overlapped.cs
- WindowsTab.cs
- DesignDataSource.cs
- MenuItemCollectionEditor.cs
- TreeIterator.cs
- HashHelper.cs
- CommandPlan.cs
- AuthorizationRule.cs
- GridViewPageEventArgs.cs
- PersonalizationProviderHelper.cs
- TreeView.cs
- hresults.cs
- SecurityCriticalDataForSet.cs
- DomainUpDown.cs
- ContextMenuAutomationPeer.cs
- ListViewHitTestInfo.cs
- _FtpControlStream.cs
- WebPartDisplayModeEventArgs.cs
- TargetException.cs
- InstanceHandleConflictException.cs