FunctionResults.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics.CodeAnalysis;
  4. namespace System.Data.Linq {
  5. /// <summary>
  6. /// The result of executing a query.
  7. /// </summary>
  8. public interface IExecuteResult : IDisposable {
  9. /// <summary>
  10. /// The return value or result of the executed query. This object has the same type as the
  11. /// query expression's Type property.
  12. /// </summary>
  13. object ReturnValue { get; }
  14. /// <summary>
  15. /// Retrieves the nth output parameter. This method is normally used when the query is a mapped
  16. /// function with output parameters.
  17. /// </summary>
  18. /// <param name="parameterIndex"></param>
  19. /// <returns></returns>
  20. object GetParameterValue(int parameterIndex);
  21. }
  22. /// <summary>
  23. /// Interface providing access to a function return value.
  24. /// </summary>
  25. public interface IFunctionResult {
  26. /// <summary>
  27. /// The value.
  28. /// </summary>
  29. object ReturnValue { get; }
  30. }
  31. /// <summary>
  32. /// An interface for representing the result of a mapped function with a single return sequence.
  33. /// </summary>
  34. [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification="tadam: Meant to represent a database table which is delayed loaded and doesn't provide collection semantics.")]
  35. public interface ISingleResult<T> : IEnumerable<T>, IFunctionResult, IDisposable { }
  36. /// <summary>
  37. /// An interface for representing results of mapped functions or queries with variable return sequences.
  38. /// </summary>
  39. public interface IMultipleResults : IFunctionResult, IDisposable {
  40. /// <summary>
  41. /// Retrieves the next result as a sequence of Type 'TElement'.
  42. /// </summary>
  43. /// <typeparam name="TElement"></typeparam>
  44. /// <returns></returns>
  45. [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "tadam: Generic parameters are required for strong-typing of the return type.")]
  46. IEnumerable<TElement> GetResult<TElement>();
  47. }
  48. }