I have method a the returns something like this:
List<Customer> customers = repository.GetCustomers.Where(x => x.IsActive);
return customers;
Visual Studio tooling is suggesting an inline temporary variable:
return repository.GetCustomers.Where(x => x.IsActive);
Years ago I heard a tip on a .Net podcast (the guest I don't recall) that there are some memory/performance advantages to the first option.
The micro-optimization question talks about this issue in a broad context. But is it indeed micro-optimization or style preference only?