FindOneAndDeleteOptions.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* Copyright 2010-2016 MongoDB Inc.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. using System;
  16. namespace MongoDB.Driver
  17. {
  18. /// <summary>
  19. /// Options for a findAndModify command to delete an object.
  20. /// </summary>
  21. /// <typeparam name="TDocument">The type of the document.</typeparam>
  22. /// <typeparam name="TProjection">The type of the projection (same as TDocument if there is no projection).</typeparam>
  23. public class FindOneAndDeleteOptions<TDocument, TProjection>
  24. {
  25. // fields
  26. private Collation _collation;
  27. private TimeSpan? _maxTime;
  28. private ProjectionDefinition<TDocument, TProjection> _projection;
  29. private SortDefinition<TDocument> _sort;
  30. // properties
  31. /// <summary>
  32. /// Gets or sets the collation.
  33. /// </summary>
  34. public Collation Collation
  35. {
  36. get { return _collation; }
  37. set { _collation = value; }
  38. }
  39. /// <summary>
  40. /// Gets or sets the maximum time.
  41. /// </summary>
  42. public TimeSpan? MaxTime
  43. {
  44. get { return _maxTime; }
  45. set { _maxTime = value; }
  46. }
  47. /// <summary>
  48. /// Gets or sets the projection.
  49. /// </summary>
  50. public ProjectionDefinition<TDocument, TProjection> Projection
  51. {
  52. get { return _projection; }
  53. set { _projection = value; }
  54. }
  55. /// <summary>
  56. /// Gets or sets the sort.
  57. /// </summary>
  58. public SortDefinition<TDocument> Sort
  59. {
  60. get { return _sort; }
  61. set { _sort = value; }
  62. }
  63. }
  64. /// <summary>
  65. /// Options for a findAndModify command to delete an object.
  66. /// </summary>
  67. /// <typeparam name="TDocument">The type of the document and the result.</typeparam>
  68. public class FindOneAndDeleteOptions<TDocument> : FindOneAndDeleteOptions<TDocument, TDocument>
  69. {
  70. }
  71. }