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
- BasicExpandProvider.cs
- TextFindEngine.cs
- EventProviderWriter.cs
- ScrollableControl.cs
- ZoneButton.cs
- ResizingMessageFilter.cs
- AmbientProperties.cs
- FileEnumerator.cs
- ListViewGroup.cs
- ImpersonationContext.cs
- ProviderIncompatibleException.cs
- ScriptDescriptor.cs
- MultipleCopiesCollection.cs
- ColorKeyFrameCollection.cs
- XmlSerializableServices.cs
- DataGridViewRowCollection.cs
- Pair.cs
- EffectiveValueEntry.cs
- InfoCardKeyedHashAlgorithm.cs
- RequestCachingSection.cs
- ClientRoleProvider.cs
- WaitForChangedResult.cs
- DateTime.cs
- Int16Storage.cs
- CompositeScriptReferenceEventArgs.cs
- FrameworkReadOnlyPropertyMetadata.cs
- XPathException.cs
- FontStyles.cs
- RadioButtonList.cs
- X509Certificate.cs
- SafeEventLogReadHandle.cs
- Hyperlink.cs
- MouseActionValueSerializer.cs
- TypeExtension.cs
- LineVisual.cs
- MetadataCache.cs
- CollectionBase.cs
- SoapTypeAttribute.cs
- CompilerError.cs
- WrapPanel.cs
- XPathSingletonIterator.cs
- RemotingConfigParser.cs
- XmlILModule.cs
- ForceCopyBuildProvider.cs
- Deflater.cs
- CachedTypeface.cs
- Clock.cs
- BitSet.cs
- XmlTextReaderImplHelpers.cs
- FontCacheUtil.cs
- BoundsDrawingContextWalker.cs
- ConnectionStringSettingsCollection.cs
- ClientSponsor.cs
- TextSelectionHighlightLayer.cs
- SqlConnectionHelper.cs
- ArrayWithOffset.cs
- HtmlEncodedRawTextWriter.cs
- Compiler.cs
- KoreanCalendar.cs
- WCFBuildProvider.cs
- PageCodeDomTreeGenerator.cs
- CoTaskMemSafeHandle.cs
- HtmlWindowCollection.cs
- HttpAsyncResult.cs
- MailHeaderInfo.cs
- UserControlCodeDomTreeGenerator.cs
- ErrorActivity.cs
- LowerCaseStringConverter.cs
- CopyOnWriteList.cs
- TextRangeEditTables.cs
- SmtpSection.cs
- DataGridColumnHeadersPresenter.cs
- CodeAttributeDeclarationCollection.cs
- FrameworkElement.cs
- ListViewGroupConverter.cs
- ImageFormat.cs
- BufferBuilder.cs
- AdapterDictionary.cs
- CalendarDay.cs
- _CommandStream.cs
- SafeNativeMethodsOther.cs
- PathSegmentCollection.cs
- DropDownList.cs
- ExpressionNode.cs
- BuildManagerHost.cs
- ProfileManager.cs
- DataGridViewRowsAddedEventArgs.cs
- TextContainerChangedEventArgs.cs
- CriticalHandle.cs
- StylusPlugInCollection.cs
- RuleSettingsCollection.cs
- BuildResultCache.cs
- RangeValueProviderWrapper.cs
- AppDomainCompilerProxy.cs
- ConditionalBranch.cs
- DataSourceGroupCollection.cs
- OleDbException.cs
- InitializerFacet.cs
- XPathNodePointer.cs
- Error.cs