Beautify and Standardize RestAPI names [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
-3
down vote

favorite












I've working with ASPNET WebAPI for quite sometimes but somehow ignored what naming conventions i was using, it was usually verbs which is opposite of what is suggested while i searched what should be done in the first place.



After following guides here and here, I've changed the APIs like this. Now routes are reflecting fine i guess but I am not sure about the actual 'action' (controller action methods).



[Produces("application/json")]
[Route("api/Appointment/TransportOrders")]
public class TransportOrderController : Controller

public TransportOrderController()




[Route("")]
public async Task<IActionResult> FilterList(string flow, string searchType, string searchValue, string status, string incidents, DateTime fromDate, DateTime toDate, string timeslot, string timeType, int pageSize = 10, int pageNumber = 1, string sortBy = "", string sortDir = "")

return Ok($"List returned flow:flow searchType:searchType");


[Route("id")]
public async Task<IActionResult> GetDetails(string id)

return Ok($"Details returned by id");


[Route("Status")]
public async Task<IActionResult> PostStatusUpdate([FromBody] StatusUpdateDTO arg)

return Ok(arg);


[Route("Companies/code")]
public async Task<IActionResult> GetCompany(string code)

return Ok($"Company Data returned by code");


[Route("Reports/id")]
public async Task<IActionResult> GetReport(string id)

return Ok($"Report Data returned by id");


[Route("Documents/id")]
public async Task<IActionResult> GetDocuments(string id)

return Ok($"Documents Data returned by id");


[Route("Combinations/id")]
public async Task<IActionResult> GetCombinations(string id)

return Ok($"Combinations Data returned by id");




Can you guys reveiw this? Is this naming convention on routes and action names fine ?







share|improve this question













closed as off-topic by Toby Speight, Stephen Rauch, Ludisposed, Mast, Sam Onela Aug 1 at 14:55


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Toby Speight, Stephen Rauch, Ludisposed, Mast, Sam Onela
If this question can be reworded to fit the rules in the help center, please edit the question.








  • 2




    This question is incomplete. To help reviewers give you better answers, please add sufficient context to your question. The more you tell us about what your code does and what the purpose of doing that is, the easier it will be for reviewers to help you. The current title states your concerns about the code; it needs an edit to simply state the task; see How to get the best value out of Code Review: Asking Questions for guidance on writing good question titles.
    – Toby Speight
    Aug 1 at 12:53










  • This is simple piece of code for some APIs. Because this is CODE REVIEW so it posted a working piece of code for improvement. I've asked only for the naming conventions REVIEW by experts.
    – Ali Umair
    Aug 2 at 7:45










  • You've missed the bit where you explain what the code is supposed to do. Please read the linked resources again - I'm sure this question can be improved enough for it to be reopened and attract good answers.
    – Toby Speight
    Aug 2 at 7:56










  • The code is a ASPNET WebAPI class as I've tagged it. Its more then clear that anyone who knows ASPNET WebAPI will see this code and know exactly what it does.
    – Ali Umair
    Aug 2 at 7:59










  • The question title says it's a naming convention. I really don't think that's what it does. Your comment is something like me saying, "This is a C program. It's obvious what it does.".
    – Toby Speight
    Aug 2 at 8:05

















up vote
-3
down vote

favorite












I've working with ASPNET WebAPI for quite sometimes but somehow ignored what naming conventions i was using, it was usually verbs which is opposite of what is suggested while i searched what should be done in the first place.



After following guides here and here, I've changed the APIs like this. Now routes are reflecting fine i guess but I am not sure about the actual 'action' (controller action methods).



[Produces("application/json")]
[Route("api/Appointment/TransportOrders")]
public class TransportOrderController : Controller

public TransportOrderController()




[Route("")]
public async Task<IActionResult> FilterList(string flow, string searchType, string searchValue, string status, string incidents, DateTime fromDate, DateTime toDate, string timeslot, string timeType, int pageSize = 10, int pageNumber = 1, string sortBy = "", string sortDir = "")

return Ok($"List returned flow:flow searchType:searchType");


[Route("id")]
public async Task<IActionResult> GetDetails(string id)

return Ok($"Details returned by id");


[Route("Status")]
public async Task<IActionResult> PostStatusUpdate([FromBody] StatusUpdateDTO arg)

return Ok(arg);


[Route("Companies/code")]
public async Task<IActionResult> GetCompany(string code)

return Ok($"Company Data returned by code");


[Route("Reports/id")]
public async Task<IActionResult> GetReport(string id)

return Ok($"Report Data returned by id");


[Route("Documents/id")]
public async Task<IActionResult> GetDocuments(string id)

return Ok($"Documents Data returned by id");


[Route("Combinations/id")]
public async Task<IActionResult> GetCombinations(string id)

return Ok($"Combinations Data returned by id");




Can you guys reveiw this? Is this naming convention on routes and action names fine ?







share|improve this question













closed as off-topic by Toby Speight, Stephen Rauch, Ludisposed, Mast, Sam Onela Aug 1 at 14:55


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Toby Speight, Stephen Rauch, Ludisposed, Mast, Sam Onela
If this question can be reworded to fit the rules in the help center, please edit the question.








  • 2




    This question is incomplete. To help reviewers give you better answers, please add sufficient context to your question. The more you tell us about what your code does and what the purpose of doing that is, the easier it will be for reviewers to help you. The current title states your concerns about the code; it needs an edit to simply state the task; see How to get the best value out of Code Review: Asking Questions for guidance on writing good question titles.
    – Toby Speight
    Aug 1 at 12:53










  • This is simple piece of code for some APIs. Because this is CODE REVIEW so it posted a working piece of code for improvement. I've asked only for the naming conventions REVIEW by experts.
    – Ali Umair
    Aug 2 at 7:45










  • You've missed the bit where you explain what the code is supposed to do. Please read the linked resources again - I'm sure this question can be improved enough for it to be reopened and attract good answers.
    – Toby Speight
    Aug 2 at 7:56










  • The code is a ASPNET WebAPI class as I've tagged it. Its more then clear that anyone who knows ASPNET WebAPI will see this code and know exactly what it does.
    – Ali Umair
    Aug 2 at 7:59










  • The question title says it's a naming convention. I really don't think that's what it does. Your comment is something like me saying, "This is a C program. It's obvious what it does.".
    – Toby Speight
    Aug 2 at 8:05













up vote
-3
down vote

favorite









up vote
-3
down vote

favorite











I've working with ASPNET WebAPI for quite sometimes but somehow ignored what naming conventions i was using, it was usually verbs which is opposite of what is suggested while i searched what should be done in the first place.



After following guides here and here, I've changed the APIs like this. Now routes are reflecting fine i guess but I am not sure about the actual 'action' (controller action methods).



[Produces("application/json")]
[Route("api/Appointment/TransportOrders")]
public class TransportOrderController : Controller

public TransportOrderController()




[Route("")]
public async Task<IActionResult> FilterList(string flow, string searchType, string searchValue, string status, string incidents, DateTime fromDate, DateTime toDate, string timeslot, string timeType, int pageSize = 10, int pageNumber = 1, string sortBy = "", string sortDir = "")

return Ok($"List returned flow:flow searchType:searchType");


[Route("id")]
public async Task<IActionResult> GetDetails(string id)

return Ok($"Details returned by id");


[Route("Status")]
public async Task<IActionResult> PostStatusUpdate([FromBody] StatusUpdateDTO arg)

return Ok(arg);


[Route("Companies/code")]
public async Task<IActionResult> GetCompany(string code)

return Ok($"Company Data returned by code");


[Route("Reports/id")]
public async Task<IActionResult> GetReport(string id)

return Ok($"Report Data returned by id");


[Route("Documents/id")]
public async Task<IActionResult> GetDocuments(string id)

return Ok($"Documents Data returned by id");


[Route("Combinations/id")]
public async Task<IActionResult> GetCombinations(string id)

return Ok($"Combinations Data returned by id");




Can you guys reveiw this? Is this naming convention on routes and action names fine ?







share|improve this question













I've working with ASPNET WebAPI for quite sometimes but somehow ignored what naming conventions i was using, it was usually verbs which is opposite of what is suggested while i searched what should be done in the first place.



After following guides here and here, I've changed the APIs like this. Now routes are reflecting fine i guess but I am not sure about the actual 'action' (controller action methods).



[Produces("application/json")]
[Route("api/Appointment/TransportOrders")]
public class TransportOrderController : Controller

public TransportOrderController()




[Route("")]
public async Task<IActionResult> FilterList(string flow, string searchType, string searchValue, string status, string incidents, DateTime fromDate, DateTime toDate, string timeslot, string timeType, int pageSize = 10, int pageNumber = 1, string sortBy = "", string sortDir = "")

return Ok($"List returned flow:flow searchType:searchType");


[Route("id")]
public async Task<IActionResult> GetDetails(string id)

return Ok($"Details returned by id");


[Route("Status")]
public async Task<IActionResult> PostStatusUpdate([FromBody] StatusUpdateDTO arg)

return Ok(arg);


[Route("Companies/code")]
public async Task<IActionResult> GetCompany(string code)

return Ok($"Company Data returned by code");


[Route("Reports/id")]
public async Task<IActionResult> GetReport(string id)

return Ok($"Report Data returned by id");


[Route("Documents/id")]
public async Task<IActionResult> GetDocuments(string id)

return Ok($"Documents Data returned by id");


[Route("Combinations/id")]
public async Task<IActionResult> GetCombinations(string id)

return Ok($"Combinations Data returned by id");




Can you guys reveiw this? Is this naming convention on routes and action names fine ?









share|improve this question












share|improve this question




share|improve this question








edited Aug 2 at 8:23
























asked Aug 1 at 10:25









Ali Umair

953




953




closed as off-topic by Toby Speight, Stephen Rauch, Ludisposed, Mast, Sam Onela Aug 1 at 14:55


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Toby Speight, Stephen Rauch, Ludisposed, Mast, Sam Onela
If this question can be reworded to fit the rules in the help center, please edit the question.




closed as off-topic by Toby Speight, Stephen Rauch, Ludisposed, Mast, Sam Onela Aug 1 at 14:55


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – Toby Speight, Stephen Rauch, Ludisposed, Mast, Sam Onela
If this question can be reworded to fit the rules in the help center, please edit the question.







  • 2




    This question is incomplete. To help reviewers give you better answers, please add sufficient context to your question. The more you tell us about what your code does and what the purpose of doing that is, the easier it will be for reviewers to help you. The current title states your concerns about the code; it needs an edit to simply state the task; see How to get the best value out of Code Review: Asking Questions for guidance on writing good question titles.
    – Toby Speight
    Aug 1 at 12:53










  • This is simple piece of code for some APIs. Because this is CODE REVIEW so it posted a working piece of code for improvement. I've asked only for the naming conventions REVIEW by experts.
    – Ali Umair
    Aug 2 at 7:45










  • You've missed the bit where you explain what the code is supposed to do. Please read the linked resources again - I'm sure this question can be improved enough for it to be reopened and attract good answers.
    – Toby Speight
    Aug 2 at 7:56










  • The code is a ASPNET WebAPI class as I've tagged it. Its more then clear that anyone who knows ASPNET WebAPI will see this code and know exactly what it does.
    – Ali Umair
    Aug 2 at 7:59










  • The question title says it's a naming convention. I really don't think that's what it does. Your comment is something like me saying, "This is a C program. It's obvious what it does.".
    – Toby Speight
    Aug 2 at 8:05













  • 2




    This question is incomplete. To help reviewers give you better answers, please add sufficient context to your question. The more you tell us about what your code does and what the purpose of doing that is, the easier it will be for reviewers to help you. The current title states your concerns about the code; it needs an edit to simply state the task; see How to get the best value out of Code Review: Asking Questions for guidance on writing good question titles.
    – Toby Speight
    Aug 1 at 12:53










  • This is simple piece of code for some APIs. Because this is CODE REVIEW so it posted a working piece of code for improvement. I've asked only for the naming conventions REVIEW by experts.
    – Ali Umair
    Aug 2 at 7:45










  • You've missed the bit where you explain what the code is supposed to do. Please read the linked resources again - I'm sure this question can be improved enough for it to be reopened and attract good answers.
    – Toby Speight
    Aug 2 at 7:56










  • The code is a ASPNET WebAPI class as I've tagged it. Its more then clear that anyone who knows ASPNET WebAPI will see this code and know exactly what it does.
    – Ali Umair
    Aug 2 at 7:59










  • The question title says it's a naming convention. I really don't think that's what it does. Your comment is something like me saying, "This is a C program. It's obvious what it does.".
    – Toby Speight
    Aug 2 at 8:05








2




2




This question is incomplete. To help reviewers give you better answers, please add sufficient context to your question. The more you tell us about what your code does and what the purpose of doing that is, the easier it will be for reviewers to help you. The current title states your concerns about the code; it needs an edit to simply state the task; see How to get the best value out of Code Review: Asking Questions for guidance on writing good question titles.
– Toby Speight
Aug 1 at 12:53




This question is incomplete. To help reviewers give you better answers, please add sufficient context to your question. The more you tell us about what your code does and what the purpose of doing that is, the easier it will be for reviewers to help you. The current title states your concerns about the code; it needs an edit to simply state the task; see How to get the best value out of Code Review: Asking Questions for guidance on writing good question titles.
– Toby Speight
Aug 1 at 12:53












This is simple piece of code for some APIs. Because this is CODE REVIEW so it posted a working piece of code for improvement. I've asked only for the naming conventions REVIEW by experts.
– Ali Umair
Aug 2 at 7:45




This is simple piece of code for some APIs. Because this is CODE REVIEW so it posted a working piece of code for improvement. I've asked only for the naming conventions REVIEW by experts.
– Ali Umair
Aug 2 at 7:45












You've missed the bit where you explain what the code is supposed to do. Please read the linked resources again - I'm sure this question can be improved enough for it to be reopened and attract good answers.
– Toby Speight
Aug 2 at 7:56




You've missed the bit where you explain what the code is supposed to do. Please read the linked resources again - I'm sure this question can be improved enough for it to be reopened and attract good answers.
– Toby Speight
Aug 2 at 7:56












The code is a ASPNET WebAPI class as I've tagged it. Its more then clear that anyone who knows ASPNET WebAPI will see this code and know exactly what it does.
– Ali Umair
Aug 2 at 7:59




The code is a ASPNET WebAPI class as I've tagged it. Its more then clear that anyone who knows ASPNET WebAPI will see this code and know exactly what it does.
– Ali Umair
Aug 2 at 7:59












The question title says it's a naming convention. I really don't think that's what it does. Your comment is something like me saying, "This is a C program. It's obvious what it does.".
– Toby Speight
Aug 2 at 8:05





The question title says it's a naming convention. I really don't think that's what it does. Your comment is something like me saying, "This is a C program. It's obvious what it does.".
– Toby Speight
Aug 2 at 8:05
















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Greedy Best First Search implementation in Rust

Function to Return a JSON Like Objects Using VBA Collections and Arrays

C++11 CLH Lock Implementation