AggregateBucketAutoResultId.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* Copyright 2016-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. using MongoDB.Bson.Serialization.Attributes;
  16. namespace MongoDB.Driver
  17. {
  18. /// <summary>
  19. /// Represents the _id value in the result of a $bucketAuto stage.
  20. /// </summary>
  21. /// <typeparam name="TValue">The type of the values.</typeparam>
  22. public class AggregateBucketAutoResultId<TValue>
  23. {
  24. private readonly TValue _min;
  25. private readonly TValue _max;
  26. /// <summary>
  27. /// Initializes a new instance of the <see cref="AggregateBucketAutoResultId{TValue}"/> class.
  28. /// </summary>
  29. /// <param name="min">The minimum.</param>
  30. /// <param name="max">The maximum.</param>
  31. public AggregateBucketAutoResultId(TValue min, TValue max)
  32. {
  33. _min = min;
  34. _max = max;
  35. }
  36. /// <summary>
  37. /// Gets the max value.
  38. /// </summary>
  39. [BsonElement("max")]
  40. public TValue Max => _max;
  41. /// <summary>
  42. /// Gets the min value.
  43. /// </summary>
  44. [BsonElement("min")]
  45. public TValue Min => _min;
  46. }
  47. }