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
- DataSourceProvider.cs
- PropertyChangedEventManager.cs
- ResourceReferenceExpressionConverter.cs
- CharEnumerator.cs
- PaperSource.cs
- CharacterMetrics.cs
- BooleanSwitch.cs
- HttpRawResponse.cs
- Monitor.cs
- StrongTypingException.cs
- filewebresponse.cs
- RemotingServices.cs
- PropertyPushdownHelper.cs
- ServiceModelActivity.cs
- TextReader.cs
- SqlDataReaderSmi.cs
- WebPartVerbCollection.cs
- ConnectionStringsSection.cs
- BrowserTree.cs
- ContainsSearchOperator.cs
- ControlValuePropertyAttribute.cs
- Empty.cs
- WebPartTracker.cs
- ExpandoObject.cs
- Missing.cs
- _UncName.cs
- DataGridViewUtilities.cs
- ValidatingPropertiesEventArgs.cs
- QueryCacheEntry.cs
- connectionpool.cs
- DetailsViewAutoFormat.cs
- UserPreferenceChangingEventArgs.cs
- OdbcDataReader.cs
- FlowDecision.cs
- ArrayConverter.cs
- ScriptRef.cs
- DesignerDataParameter.cs
- DataControlFieldHeaderCell.cs
- Avt.cs
- RelativeSource.cs
- PersistenceProvider.cs
- InstanceCreationEditor.cs
- ChameleonKey.cs
- DbConvert.cs
- LoginUtil.cs
- DependencyPropertyChangedEventArgs.cs
- SimpleApplicationHost.cs
- Menu.cs
- PartialTrustVisibleAssemblyCollection.cs
- HandledMouseEvent.cs
- SqlDataReaderSmi.cs
- CatalogPartChrome.cs
- IdentitySection.cs
- LinqDataView.cs
- DoubleKeyFrameCollection.cs
- Parser.cs
- RepeaterCommandEventArgs.cs
- BamlTreeUpdater.cs
- Pair.cs
- SortQuery.cs
- TextWriter.cs
- ProxyFragment.cs
- _LazyAsyncResult.cs
- SHA384CryptoServiceProvider.cs
- ProcessInfo.cs
- Visual3DCollection.cs
- ToolStripItem.cs
- CodeIterationStatement.cs
- CodePrimitiveExpression.cs
- SourceFileBuildProvider.cs
- WebPartHeaderCloseVerb.cs
- CustomTokenProvider.cs
- IIS7WorkerRequest.cs
- SiteMapHierarchicalDataSourceView.cs
- StructuredType.cs
- LoginCancelEventArgs.cs
- PerfCounters.cs
- ToolStripPanel.cs
- DocumentSequenceHighlightLayer.cs
- TemplatedControlDesigner.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- RuntimeVariablesExpression.cs
- ShaderEffect.cs
- RegexGroupCollection.cs
- MetadataHelper.cs
- RegexStringValidator.cs
- EnumBuilder.cs
- RolePrincipal.cs
- DataGridViewRowPrePaintEventArgs.cs
- EnumUnknown.cs
- Triangle.cs
- IPEndPoint.cs
- TextSyndicationContentKindHelper.cs
- SubMenuStyle.cs
- FragmentNavigationEventArgs.cs
- LoginCancelEventArgs.cs
- CollectionBase.cs
- PersonalizationStateInfoCollection.cs
- StrokeNode.cs
- CheckedListBox.cs