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
- DocumentPage.cs
- CodeEventReferenceExpression.cs
- WebBaseEventKeyComparer.cs
- DataColumn.cs
- WindowsRegion.cs
- EUCJPEncoding.cs
- RectAnimationBase.cs
- SHA256CryptoServiceProvider.cs
- RegexReplacement.cs
- TypeLibConverter.cs
- PassportPrincipal.cs
- SqlDataSourceRefreshSchemaForm.cs
- Calendar.cs
- TimerElapsedEvenArgs.cs
- CardSpaceShim.cs
- httpserverutility.cs
- SyndicationElementExtensionCollection.cs
- TemplateInstanceAttribute.cs
- Pens.cs
- RoutedUICommand.cs
- ProfileSection.cs
- PackageFilter.cs
- TypeInfo.cs
- DbProviderManifest.cs
- ReceiveMessageRecord.cs
- HttpCookiesSection.cs
- BezierSegment.cs
- DocumentSequence.cs
- Int16.cs
- Italic.cs
- MenuItem.cs
- LogLogRecordEnumerator.cs
- InlinedAggregationOperator.cs
- BaseParaClient.cs
- ImageCodecInfoPrivate.cs
- XmlSchemaDocumentation.cs
- DefaultConfirmation.cs
- DataGridViewControlCollection.cs
- ChtmlTextWriter.cs
- CrossSiteScriptingValidation.cs
- OleDbPropertySetGuid.cs
- DispatchWrapper.cs
- mediaeventargs.cs
- DeflateStream.cs
- EntityObject.cs
- ValidatingReaderNodeData.cs
- IDReferencePropertyAttribute.cs
- ContainerSelectorBehavior.cs
- ContractBase.cs
- TreeViewHitTestInfo.cs
- ListManagerBindingsCollection.cs
- ErrorBehavior.cs
- RSAProtectedConfigurationProvider.cs
- AssemblyBuilder.cs
- PointAnimation.cs
- TemplateLookupAction.cs
- KerberosSecurityTokenAuthenticator.cs
- BinaryFormatterWriter.cs
- XpsResourceDictionary.cs
- Perspective.cs
- DnsEndPoint.cs
- RangeContentEnumerator.cs
- MissingMethodException.cs
- TypeReference.cs
- IODescriptionAttribute.cs
- LinqDataSourceDisposeEventArgs.cs
- FormViewCommandEventArgs.cs
- TagElement.cs
- TextContainerChangedEventArgs.cs
- Bits.cs
- SqlDataSource.cs
- AdapterUtil.cs
- PathSegment.cs
- VisualStyleInformation.cs
- ProxyAttribute.cs
- PreloadedPackages.cs
- Recipient.cs
- QueryResponse.cs
- BaseParaClient.cs
- ICollection.cs
- XmlPropertyBag.cs
- EventDescriptor.cs
- SoapRpcServiceAttribute.cs
- DrawingGroup.cs
- BamlTreeUpdater.cs
- StandardToolWindows.cs
- _UriTypeConverter.cs
- PageSettings.cs
- HtmlTernaryTree.cs
- IERequestCache.cs
- TreeViewHitTestInfo.cs
- TdsParserStateObject.cs
- FilterQueryOptionExpression.cs
- PersonalizationProviderHelper.cs
- ControlParameter.cs
- TransactionContext.cs
- CheckBox.cs
- XmlSchemaSimpleTypeRestriction.cs
- Transform.cs
- UrlAuthorizationModule.cs