Builders.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* Copyright 2010-present 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. namespace MongoDB.Driver
  16. {
  17. /// <summary>
  18. /// A static helper class containing various builders.
  19. /// </summary>
  20. /// <typeparam name="TDocument">The type of the document.</typeparam>
  21. public static class Builders<TDocument>
  22. {
  23. private static FilterDefinitionBuilder<TDocument> __filter = new FilterDefinitionBuilder<TDocument>();
  24. private static IndexKeysDefinitionBuilder<TDocument> __index = new IndexKeysDefinitionBuilder<TDocument>();
  25. private static ProjectionDefinitionBuilder<TDocument> __projection = new ProjectionDefinitionBuilder<TDocument>();
  26. private static SortDefinitionBuilder<TDocument> __sort = new SortDefinitionBuilder<TDocument>();
  27. private static UpdateDefinitionBuilder<TDocument> __update = new UpdateDefinitionBuilder<TDocument>();
  28. /// <summary>
  29. /// Gets a <see cref="FilterDefinitionBuilder{TDocument}"/>.
  30. /// </summary>
  31. public static FilterDefinitionBuilder<TDocument> Filter
  32. {
  33. get { return __filter; }
  34. }
  35. /// <summary>
  36. /// Gets an <see cref="IndexKeysDefinitionBuilder{TDocument}"/>.
  37. /// </summary>
  38. public static IndexKeysDefinitionBuilder<TDocument> IndexKeys
  39. {
  40. get { return __index; }
  41. }
  42. /// <summary>
  43. /// Gets a <see cref="ProjectionDefinitionBuilder{TDocument}"/>.
  44. /// </summary>
  45. public static ProjectionDefinitionBuilder<TDocument> Projection
  46. {
  47. get { return __projection; }
  48. }
  49. /// <summary>
  50. /// Gets a <see cref="SortDefinitionBuilder{TDocument}"/>.
  51. /// </summary>
  52. public static SortDefinitionBuilder<TDocument> Sort
  53. {
  54. get { return __sort; }
  55. }
  56. /// <summary>
  57. /// Gets an <see cref="UpdateDefinitionBuilder{TDocument}"/>.
  58. /// </summary>
  59. public static UpdateDefinitionBuilder<TDocument> Update
  60. {
  61. get { return __update; }
  62. }
  63. }
  64. }