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
- Int32Animation.cs
- AspProxy.cs
- SafeTimerHandle.cs
- TextEncodedRawTextWriter.cs
- PrintDocument.cs
- WebReferencesBuildProvider.cs
- GetMemberBinder.cs
- MemoryRecordBuffer.cs
- OletxEnlistment.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- ParagraphVisual.cs
- Drawing.cs
- LambdaCompiler.Address.cs
- Binding.cs
- TextSegment.cs
- ExpressionVisitor.cs
- _LocalDataStore.cs
- CapabilitiesSection.cs
- ReflectionTypeLoadException.cs
- UnsafeNativeMethods.cs
- ModifiableIteratorCollection.cs
- ApplicationId.cs
- ControlCachePolicy.cs
- DuplicateDetector.cs
- Color.cs
- SecurityDocument.cs
- HideDisabledControlAdapter.cs
- PlainXmlDeserializer.cs
- SqlXmlStorage.cs
- TypeSemantics.cs
- CodeArrayIndexerExpression.cs
- EntityEntry.cs
- DataIdProcessor.cs
- DataGridItem.cs
- SchemaMapping.cs
- PerformanceCounterPermission.cs
- ObjectDataSourceFilteringEventArgs.cs
- TraceSection.cs
- LiteralControl.cs
- ComponentConverter.cs
- Enum.cs
- Registry.cs
- ExpressionBuilderContext.cs
- ObjectResult.cs
- EntitySqlQueryBuilder.cs
- COM2EnumConverter.cs
- AuthenticationConfig.cs
- ScrollBarRenderer.cs
- TextFragmentEngine.cs
- TextModifierScope.cs
- Cell.cs
- SafeMILHandle.cs
- LinkedList.cs
- SiteMapHierarchicalDataSourceView.cs
- CutCopyPasteHelper.cs
- LayoutSettings.cs
- NativeObjectSecurity.cs
- StrongNamePublicKeyBlob.cs
- CodeExpressionStatement.cs
- DataObjectAttribute.cs
- ByteAnimationBase.cs
- FieldBuilder.cs
- HtmlInputReset.cs
- MessagePropertyAttribute.cs
- XmlReflectionImporter.cs
- DataBoundControlHelper.cs
- BrowserCapabilitiesCodeGenerator.cs
- SystemIPInterfaceStatistics.cs
- ValueHandle.cs
- ToolStripDropDownItem.cs
- JsonSerializer.cs
- xmlglyphRunInfo.cs
- PeerEndPoint.cs
- GeometryDrawing.cs
- HatchBrush.cs
- HideDisabledControlAdapter.cs
- ListBoxDesigner.cs
- RequiredFieldValidator.cs
- OleDbCommand.cs
- AssemblyEvidenceFactory.cs
- WindowAutomationPeer.cs
- CodeConstructor.cs
- MsmqInputChannel.cs
- DataGridTextBoxColumn.cs
- UITypeEditor.cs
- GenericUriParser.cs
- ISAPIRuntime.cs
- Rect.cs
- CalendarDay.cs
- TextLine.cs
- SupportingTokenSecurityTokenResolver.cs
- PropertyTabAttribute.cs
- StorageTypeMapping.cs
- PopupRootAutomationPeer.cs
- UnsafeNativeMethodsCLR.cs
- PersonalizationEntry.cs
- Decimal.cs
- SettingsPropertyWrongTypeException.cs
- VectorAnimationBase.cs
- InvalidFilterCriteriaException.cs