Skip to content

[Bug]: Unexpected incremental indentation for chained .ThenInclude() calls #1828

@uf-fipper

Description

@uf-fipper

Description

I wrote the following code:

var results = await query
    .Include(x => x.T1)
    .ThenInclude(x => x.T2)
    .ThenInclude(x => x.T3)
    .ThenInclude(x => x.T4)
    .ThenInclude(x => x.T5)
    .ToListAsync();

but it is formatted to:

var results = await query
    .Include(x => x.T1)
        .ThenInclude(x => x.T2)
            .ThenInclude(x => x.T3)
                .ThenInclude(x => x.T4)
                    .ThenInclude(x => x.T5)
    .ToListAsync();

according to issue #1602 , all .ThenInclude() calls following an .Include() should share the same level of indentation:

var results = await query
    .Include(x => x.T1)
        .ThenInclude(x => x.T2)
        .ThenInclude(x => x.T3)
        .ThenInclude(x => x.T4)
        .ThenInclude(x => x.T5)
    .ToListAsync();

Is this a regression, or is there an existing configuration to ensure .ThenInclude stays at the same indentation level?

Steps to Reproduce

var results = await query
    .Include(x => x.T1)
    .ThenInclude(x => x.T2)
    .ThenInclude(x => x.T3)
    .ThenInclude(x => x.T4)
    .ThenInclude(x => x.T5)
    .ToListAsync();

Expected Behavior

var results = await query
    .Include(x => x.T1)
        .ThenInclude(x => x.T2)
        .ThenInclude(x => x.T3)
        .ThenInclude(x => x.T4)
        .ThenInclude(x => x.T5)
    .ToListAsync();

Actual Behavior

var results = await query
    .Include(x => x.T1)
        .ThenInclude(x => x.T2)
            .ThenInclude(x => x.T3)
                .ThenInclude(x => x.T4)
                    .ThenInclude(x => x.T5)
    .ToListAsync();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions