Skip to content

Commit 1cd2f83

Browse files
Expose Expand(IEnumerable<ODataExpandAssociation>) on IFluentClient
FluentCommand has had Expand(IEnumerable<ODataExpandAssociation>) for a while, but the fluent client surface (IFluentClient/FluentClientBase) only takes strings or ODataExpressions and constructs the associations internally via ODataExpandAssociation.From — consumers never see the resulting objects and so can't attach a FilterExpression or OrderByColumns to a specific expansion without reaching into Command.Details by reflection. Add a public IFluentClient<T,FT>.Expand(IEnumerable<ODataExpandAssociation>) overload (and its ODataExpandOptions twin) so callers that need to build per-expansion configuration can do it upfront. The implementation just forwards to the existing FluentCommand.Expand overload, so there's no behaviour change for existing callers. Bump AssemblyVersion to 6.0.2.0. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b81ee32 commit 1cd2f83

3 files changed

Lines changed: 32 additions & 1 deletion

File tree

src/GXOdata.Client.All/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
44

55
<PropertyGroup>
6-
<AssemblyVersion>6.0.1.0</AssemblyVersion>
6+
<AssemblyVersion>6.0.2.0</AssemblyVersion>
77
<FileVersion>$(AssemblyVersion)</FileVersion>
88
<InformationalVersion>$([System.DateTime]::UtcNow.ToString("yyyyMMddHHmmss")).$(GITHUB_SHA)</InformationalVersion>
99
<Company>GeneXus</Company>

src/Simple.OData.Client.Core/Fluent/FluentClientBase.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,18 @@ public FT Expand(ODataExpandOptions expandOptions, params ODataExpression[] asso
218218
return this as FT;
219219
}
220220

221+
public FT Expand(IEnumerable<ODataExpandAssociation> associations)
222+
{
223+
Command.Expand(associations);
224+
return this as FT;
225+
}
226+
227+
public FT Expand(ODataExpandOptions expandOptions, IEnumerable<ODataExpandAssociation> associations)
228+
{
229+
Command.Expand(expandOptions, associations);
230+
return this as FT;
231+
}
232+
221233
public FT Expand(Expression<Func<T, object>> expression)
222234
{
223235
Command.Expand(expression.ExtractExpandAssociations(_session.TypeCache));

src/Simple.OData.Client.Core/Fluent/IFluentClient.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,25 @@ public interface IFluentClient<T, FT>
186186
/// <returns>Self.</returns>
187187
FT Expand(ODataExpandOptions expandOptions, params ODataExpression[] associations);
188188

189+
/// <summary>
190+
/// Expands the specified associations. Callers that need to attach a
191+
/// <see cref="ODataExpandAssociation.FilterExpression"/> or
192+
/// <see cref="ODataExpandAssociation.OrderByColumns"/> to an expanded
193+
/// entity can build the <see cref="ODataExpandAssociation"/> chain
194+
/// upfront and pass it through this overload.
195+
/// </summary>
196+
/// <param name="associations">The associations to expand.</param>
197+
/// <returns>Self.</returns>
198+
FT Expand(IEnumerable<ODataExpandAssociation> associations);
199+
200+
/// <summary>
201+
/// Expands the specified associations using the given expand options.
202+
/// </summary>
203+
/// <param name="expandOptions">The <see cref="ODataExpandOptions"/>.</param>
204+
/// <param name="associations">The associations to expand.</param>
205+
/// <returns>Self.</returns>
206+
FT Expand(ODataExpandOptions expandOptions, IEnumerable<ODataExpandAssociation> associations);
207+
189208
/// <summary>
190209
/// Expands the top level of the specified expression.
191210
/// </summary>

0 commit comments

Comments
 (0)