Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

Controller method naming, any sense in staying with traditional verbs?

$
0
0

With Web API 2 and attribute routing, it seems I can easily name my api controller methods anything I want.  For example, instead of a Get(), I can have a GetStudents(), and instead of Get(int Id) I can have GetStudentById(int ID), etc.  It works great.

The thing I have noticed, is my mvc front end has the same controller methods.  So my GetStudentById(int Id) method in my mvc front end StudentController is getting data from my GetStudentById(int Id) method in my web api StudentController.

Is there any problem with naming my api methods this way? It works fine, so...  does it even matter?


Viewing all articles
Browse latest Browse all 4850

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>