Allow, but not force, named arguments

I want to allow named arguments, but I don't want them to be forced. So if I have the following code:

ConvertUnits(
			addOrRemoveStockVm.AmountAddedOrRemoved,
			fromUnits: addOrRemoveStockVm.ConsumingUnitsEnum,
			toUnits: dbChemicalContainer.UnitOfMeasureEnum
		);

I want to keep the named arguments for the last two parameters, but I don't want it to be forced one way or another. When I hit save and the code clean-up runs, “fromUnits” and “toUnits” are removed. How do I prevent this?

0
1 comment

Rider supports configuring named arguments based on the argument types. You can refer to this documentation to adjust the corresponding code style settings.

0

Please sign in to leave a comment.