Click here to Skip to main content
16,019,618 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Hotel ERP system Pin
Richard Deeming24-Aug-20 4:52
mveRichard Deeming24-Aug-20 4:52 
AnswerRe: Hotel ERP system Pin
Mycroft Holmes24-Aug-20 12:22
professionalMycroft Holmes24-Aug-20 12:22 
GeneralRe: Hotel ERP system Pin
CHill604-Sep-20 0:37
mveCHill604-Sep-20 0:37 
AnswerRe: Hotel ERP system Pin
Eddy Vluggen24-Aug-20 12:39
professionalEddy Vluggen24-Aug-20 12:39 
Question.Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
jkirkerx19-Aug-20 8:39
professionaljkirkerx19-Aug-20 8:39 
AnswerRe: .Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
jkirkerx19-Aug-20 10:04
professionaljkirkerx19-Aug-20 10:04 
AnswerRe: .Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
Richard Deeming19-Aug-20 21:58
mveRichard Deeming19-Aug-20 21:58 
GeneralRe: .Net Core 3.2 Controller, using route and HttpGet attribute with CreatedAtRoute Pin
jkirkerx20-Aug-20 4:33
professionaljkirkerx20-Aug-20 4: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 9:43
professionaljkirkerx21-Aug-20 9:43 
Questionsubmit button Pin
Member 1491014318-Aug-20 23:40
Member 1491014318-Aug-20 23:40 
SuggestionRe: submit button Pin
Richard MacCutchan19-Aug-20 0:16
mveRichard MacCutchan19-Aug-20 0:16 
GeneralRe: submit button Pin
Member 1491014319-Aug-20 0:34
Member 1491014319-Aug-20 0:34 
GeneralRe: submit button Pin
Richard MacCutchan19-Aug-20 0:41
mveRichard MacCutchan19-Aug-20 0:41 
GeneralRe: submit button Pin
Member 1491014319-Aug-20 1:05
Member 1491014319-Aug-20 1:05 
AnswerRe: submit button Pin
F-ES Sitecore19-Aug-20 0:37
professionalF-ES Sitecore19-Aug-20 0:37 
GeneralRe: submit button Pin
Member 1491014319-Aug-20 0:46
Member 1491014319-Aug-20 0:46 
GeneralRe: submit button Pin
F-ES Sitecore19-Aug-20 1:46
professionalF-ES Sitecore19-Aug-20 1:46 
AnswerRe: submit button Pin
Otekpo Emmanuel19-Aug-20 7:56
Otekpo Emmanuel19-Aug-20 7:56 
QuestionRe: submit button Pin
ZurdoDev28-Aug-20 4:51
professionalZurdoDev28-Aug-20 4:51 
QuestionWhy ASP.NET MVC\Core ??? Pin
Steve Naidamast16-Aug-20 6:38
professionalSteve Naidamast16-Aug-20 6:38 
AnswerRe: Why ASP.NET MVC\Core ??? Pin
Mycroft Holmes16-Aug-20 12:53
professionalMycroft Holmes16-Aug-20 12:53 
GeneralRe: Why ASP.NET MVC\Core ??? Pin
Steve Naidamast18-Aug-20 6:51
professionalSteve Naidamast18-Aug-20 6:51 
GeneralRe: Why ASP.NET MVC\Core ??? Pin
Mycroft Holmes18-Aug-20 12:11
professionalMycroft Holmes18-Aug-20 12:11 
GeneralRe: Why ASP.NET MVC\Core ??? Pin
Steve Naidamast18-Aug-20 12:28
professionalSteve Naidamast18-Aug-20 12:28 
AnswerRe: Why ASP.NET MVC\Core ??? Pin
Richard Deeming16-Aug-20 22:47
mveRichard Deeming16-Aug-20 22: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.