S4261 // Methods should be named according to their synchronicities should not apply to controllers

csharp

(Paul Hickman) #1

Version 7.5.0.660

Rule S4261 suggests method Xyz should renamed to XyzAsync if it is an async method. This rule should be suppressed for any public method on a class that derives from the MVC Controller base class, as this may interfere with routing.


(Valeri Hristov) #2

Hi @paulhickman, indeed you are right, it seems that the MVC controller routing breaks when you change, but Web API controllers handle the Async suffix just fine (I tested with an ASP.NET Core Web Application)… I created a ticket to investigate what should be done, because it seems the exception from the rule could be a bit more complex.