ReSharper的2016.2如何修復ReSharper的對象初始化縮進方法參數
當前格式
IEnumerable<Customer> customers = dbCustomers.Select(customer => new Customer
{
Name = customer.Name,
Address = customer.Address,
Number = customer.Number
});
預計格式化
IEnumerable<Customer> customers = dbCustomers.Select(customer => new Customer
{
Name = customer.Name,
Address = customer.Address,
Number = customer.Number
});
其中ReSharper的2016.2配置可以解決這個問題?
請注意,初始化器位於參數括號內,而不是變量。
你試過這個:Options - > Code Editing - > C# - > Formatting Style - > Other - > Align Multiline Constructs - > Array,object and collection initializer –
@OscarSiauw:是的,這個選項被禁用。 –