|
| 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 | + |
| 16 | +using System.Linq; |
| 17 | + |
| 18 | +namespace MongoDB.Driver |
| 19 | +{ |
| 20 | + /// <summary> |
| 21 | + /// Represents the return result from PipelineDefinitionBuilder.GroupForLinq3 method. |
| 22 | + /// </summary> |
| 23 | + /// <typeparam name="TInput">The type of the input documents.</typeparam> |
| 24 | + /// <typeparam name="TValue">The type of the values.</typeparam> |
| 25 | + /// <typeparam name="TOutput">The type of the output documents.</typeparam> |
| 26 | + public class GroupForLinq3Result<TInput, TValue, TOutput> |
| 27 | + { |
| 28 | + internal GroupForLinq3Result(PipelineStageDefinition<TInput, IGrouping<TValue, TInput>> groupStage, PipelineStageDefinition<IGrouping<TValue, TInput>, TOutput> projectStage) |
| 29 | + { |
| 30 | + GroupStage = groupStage; |
| 31 | + ProjectStage = projectStage; |
| 32 | + } |
| 33 | + |
| 34 | + /// <summary> |
| 35 | + /// The resulting group stage. |
| 36 | + /// </summary> |
| 37 | + public PipelineStageDefinition<TInput, IGrouping<TValue, TInput>> GroupStage { get; } |
| 38 | + |
| 39 | + /// <summary> |
| 40 | + /// The resulting project stage. |
| 41 | + /// </summary> |
| 42 | + public PipelineStageDefinition<IGrouping<TValue, TInput>, TOutput> ProjectStage { get; } |
| 43 | + |
| 44 | + /// <summary> |
| 45 | + /// Deconstructs this class into its components. |
| 46 | + /// </summary> |
| 47 | + /// <param name="groupStage">The group stage.</param> |
| 48 | + /// <param name="projectStage">The project stage.</param> |
| 49 | + public void Deconstruct( |
| 50 | + out PipelineStageDefinition<TInput, IGrouping<TValue, TInput>> groupStage, |
| 51 | + out PipelineStageDefinition<IGrouping<TValue, TInput>, TOutput> projectStage) |
| 52 | + { |
| 53 | + groupStage = GroupStage; |
| 54 | + projectStage = ProjectStage; |
| 55 | + } |
| 56 | + } |
| 57 | +} |
0 commit comments