Resharper 2016.2
Current formatting
IEnumerable<Customer> customers = dbCustomers.Select(customer => new Customer
                                                     {
                                                         Name = customer.Name,
                                                         Address = customer.Address,
                                                         Number = customer.Number
                                                     });
Expected formatting
IEnumerable<Customer> customers = dbCustomers.Select(customer => new Customer
{
    Name = customer.Name,
    Address = customer.Address,
    Number = customer.Number
});
Which Resharper 2016.2 configuration can fix that?
Please note, initializer is inside argument brackets, not in variable.
If still someone needs help with this try this: Resharper Options --> Code Editing --> C# --> Formatting Style --> Other --> Uncheck "Array, object and collection initializer".
Then in: Resharper Options --> Code Editing --> C# --> Formatting Style --> Braces Layout --> "Array and object initializer" = "At next line (BSD Style)".
You could also do this, which makes it a little bit nicer: Resharper Options --> Code Editing --> C# --> Formatting Style --> Line Breaks and Wrappings --> "Wrap object and collection initializer" = "Chop if long or multiline".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With