Beautify and Standardize RestAPI names [closed]
Clash 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 ?
api rest asp.net-web-api
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
 |Â
show 1 more comment
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 ?
api rest asp.net-web-api
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
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 aASPNET WebAPI
class as I've tagged it. Its more then clear that anyone who knowsASPNET 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
 |Â
show 1 more comment
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 ?
api rest asp.net-web-api
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 ?
api rest asp.net-web-api
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
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
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 aASPNET WebAPI
class as I've tagged it. Its more then clear that anyone who knowsASPNET 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
 |Â
show 1 more comment
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 aASPNET WebAPI
class as I've tagged it. Its more then clear that anyone who knowsASPNET 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
 |Â
show 1 more comment
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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 knowsASPNET 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