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
- LocalizationParserHooks.cs
- EditCommandColumn.cs
- ErrorTableItemStyle.cs
- Page.cs
- OlePropertyStructs.cs
- NTAccount.cs
- SystemThemeKey.cs
- recordstate.cs
- ClockGroup.cs
- CodeNamespaceImport.cs
- CustomErrorsSection.cs
- DataGridViewRowHeaderCell.cs
- DataGridRowAutomationPeer.cs
- Variant.cs
- GenericTransactionFlowAttribute.cs
- KnownBoxes.cs
- TimeSpanHelper.cs
- MessageQueueKey.cs
- PipelineDeploymentState.cs
- DataBindingCollectionConverter.cs
- XmlUtf8RawTextWriter.cs
- TimelineCollection.cs
- HttpListenerPrefixCollection.cs
- MemberDescriptor.cs
- SystemInfo.cs
- CodeNamespace.cs
- ToolStripAdornerWindowService.cs
- DrawingBrush.cs
- FocusChangedEventArgs.cs
- SmtpFailedRecipientException.cs
- QueueProcessor.cs
- MetadataPropertyAttribute.cs
- XNameConverter.cs
- ResourceFallbackManager.cs
- ScriptingRoleServiceSection.cs
- SecurityState.cs
- VisemeEventArgs.cs
- DataGridColumnReorderingEventArgs.cs
- AffineTransform3D.cs
- StandardOleMarshalObject.cs
- TypeNameConverter.cs
- Assert.cs
- GraphicsPathIterator.cs
- SimpleExpression.cs
- OdbcConnection.cs
- Size3D.cs
- hresults.cs
- TemplateKeyConverter.cs
- SetIndexBinder.cs
- MimeBasePart.cs
- KeyFrames.cs
- EntityDataSourceView.cs
- PropertyChangedEventManager.cs
- TabItemWrapperAutomationPeer.cs
- Icon.cs
- StylusButtonEventArgs.cs
- XsdDataContractExporter.cs
- BinaryFormatter.cs
- MenuBase.cs
- WebPartMovingEventArgs.cs
- Query.cs
- LocalizationParserHooks.cs
- MultiBinding.cs
- Crypto.cs
- EqualityComparer.cs
- TextCollapsingProperties.cs
- ArgumentOutOfRangeException.cs
- StatusBarDrawItemEvent.cs
- WorkflowApplicationUnloadedException.cs
- AttributeCollection.cs
- StreamFormatter.cs
- SkewTransform.cs
- DodSequenceMerge.cs
- VirtualizingPanel.cs
- XamlReader.cs
- PackageFilter.cs
- ToolStripItemEventArgs.cs
- Cursors.cs
- RegistryPermission.cs
- ListViewItem.cs
- Base64Decoder.cs
- SettingsSection.cs
- PrintingPermissionAttribute.cs
- Assembly.cs
- PageContent.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- DoubleAnimation.cs
- FrameSecurityDescriptor.cs
- _SingleItemRequestCache.cs
- connectionpool.cs
- TemplateColumn.cs
- EventRoute.cs
- RepeaterCommandEventArgs.cs
- WebPartTransformer.cs
- InputLangChangeRequestEvent.cs
- SelectingProviderEventArgs.cs
- FramingDecoders.cs
- RoleBoolean.cs
- TableLayoutStyleCollection.cs
- Int32KeyFrameCollection.cs