C#C
C#4y ago
trustie

❔ Why wont visual studio auto format this with CTRL K + CTRL D?

can anyone think of why visual studio wont format these lambda arrows with CTRL K + CTRL D but it will format things around it like spacing between semicolons?
var exportBatchInputs = new List<TbExportBatchInput>()
{
    TestHelper.Fixture.Build<TbExportBatchInput>()
    .With(c => c.ExportBatchId, TestHelper.BatchID)
    .With(c=>c.FieldName, "PO Box") // note the spacing between the fat arrow here
    .With(c=>c.FieldData, "12345") // note the spacing between the fat arrow here
    .Create()
};

if i do something like this
var foo = ()=>5;

it correctly auto formats it to
var foo = () => 5;

so im not sure what the difference is in context between those 2 that would cause visual studio to not format the first instance.
Was this page helpful?