Click here to Skip to main content
15,505,828 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Hotel ERP system Pin
Richard Deeming24-Aug-20 5:52
mveRichard Deeming24-Aug-20 5:52 
AnswerRe: Hotel ERP system Pin
Mycroft Holmes24-Aug-20 13:22
professionalMycroft Holmes24-Aug-20 13:22 
GeneralRe: Hotel ERP system Pin
CHill604-Sep-20 1:37
mveCHill604-Sep-20 1:37 
AnswerRe: Hotel ERP system Pin
Eddy Vluggen24-Aug-20 13:39
professionalEddy Vluggen24-Aug-20 13:39 
Question.Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
jkirkerx19-Aug-20 9:39
professionaljkirkerx19-Aug-20 9:39 
AnswerRe: .Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
jkirkerx19-Aug-20 11:04
professionaljkirkerx19-Aug-20 11:04 
AnswerRe: .Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
Richard Deeming19-Aug-20 22:58
mveRichard Deeming19-Aug-20 22:58 
GeneralRe: .Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
jkirkerx20-Aug-20 5:33
professionaljkirkerx20-Aug-20 5:33 
I didn't think of it like that.

At the beginning before I wrote the JWT auth policies, I tried to make the app really code compact. It was just "GetOrder", then I renamed it to "GetAdminOrder" to reflect JWT Auth. I really need to streamline this naming.

return CreatedAtRoute directly? No need to return Ok. I wonder if using Ok wraps the JSON result in that extra envelope. I'll find out here, takes 10 mins to test it.

I made the code changes, and will give it a try, I'm sure it will work fine. I really don't want the extra route decorator anyways, it was just part of an example of using CreatedAtRoute I picked up over a year ago. I must admit that using CreatedAtRoute is pretty handy.
var result = CreatedAtRoute("GetAdminOrder", new { orderId = order.Id }, order);
return Ok(result);

[HttpGet("GetAdminOrder/{orderId}", Name = "GetOrder"), Authorize(AuthenticationSchemes = AuthSchemes, Policy = AuthPolicies.Admin)]        
If it ain't broke don't fix it
Discover my world at jkirkerx.com

GeneralRe: .Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
jkirkerx21-Aug-20 10:43
professionaljkirkerx21-Aug-20 10:43 
Questionsubmit button Pin
Member 1491014319-Aug-20 0:40
Member 1491014319-Aug-20 0:40 
SuggestionRe: submit button Pin
Richard MacCutchan19-Aug-20 1:16
mveRichard MacCutchan19-Aug-20 1:16 
GeneralRe: submit button Pin
Member 1491014319-Aug-20 1:34
Member 1491014319-Aug-20 1:34 
GeneralRe: submit button Pin
Richard MacCutchan19-Aug-20 1:41
mveRichard MacCutchan19-Aug-20 1:41 
GeneralRe: submit button Pin
Member 1491014319-Aug-20 2:05
Member 1491014319-Aug-20 2:05 
AnswerRe: submit button Pin
F-ES Sitecore19-Aug-20 1:37
professionalF-ES Sitecore19-Aug-20 1:37 
GeneralRe: submit button Pin
Member 1491014319-Aug-20 1:46
Member 1491014319-Aug-20 1:46 
GeneralRe: submit button Pin
F-ES Sitecore19-Aug-20 2:46
professionalF-ES Sitecore19-Aug-20 2:46 
AnswerRe: submit button Pin
Otekpo Emmanuel19-Aug-20 8:56
Otekpo Emmanuel19-Aug-20 8:56 
QuestionRe: submit button Pin
ZurdoDev28-Aug-20 5:51
professionalZurdoDev28-Aug-20 5:51 
QuestionWhy ASP.NET MVC\Core ??? Pin
Steve Naidamast16-Aug-20 7:38
professionalSteve Naidamast16-Aug-20 7:38 
AnswerRe: Why ASP.NET MVC\Core ??? Pin
Mycroft Holmes16-Aug-20 13:53
professionalMycroft Holmes16-Aug-20 13:53 
GeneralRe: Why ASP.NET MVC\Core ??? Pin
Steve Naidamast18-Aug-20 7:51
professionalSteve Naidamast18-Aug-20 7:51 
GeneralRe: Why ASP.NET MVC\Core ??? Pin
Mycroft Holmes18-Aug-20 13:11
professionalMycroft Holmes18-Aug-20 13:11 
GeneralRe: Why ASP.NET MVC\Core ??? Pin
Steve Naidamast18-Aug-20 13:28
professionalSteve Naidamast18-Aug-20 13:28 
AnswerRe: Why ASP.NET MVC\Core ??? Pin
Richard Deeming16-Aug-20 23:47
mveRichard Deeming16-Aug-20 23:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.