Click here to Skip to main content
14,333,565 members

Web Development

 
AnswerRe: Eliminating External (Commercial) References/Creating my own design/Stylesheets Pin
#realJSOP10-Jun-19 5:08
mve#realJSOP10-Jun-19 5:08 
QuestionHow to learn python numpy library easily, which functions are important Pin
Member 144829305-Jun-19 22:54
memberMember 144829305-Jun-19 22:54 
AnswerRe: How to learn python numpy library easily, which functions are important Pin
Vinod Jangle6-Jun-19 3:56
memberVinod Jangle6-Jun-19 3:56 
SuggestionRe: How to learn python numpy library easily, which functions are important Pin
Richard Deeming6-Jun-19 4:38
mveRichard Deeming6-Jun-19 4:38 
GeneralRe: How to learn python numpy library easily, which functions are important Pin
Vinod Jangle6-Jun-19 6:05
memberVinod Jangle6-Jun-19 6:05 
GeneralMessage Closed Pin
9-Jun-19 23:49
memberjamieereynoldss9-Jun-19 23:49 
AnswerMessage Closed Pin
15-Jun-19 3:55
memberRahul Khot15-Jun-19 3:55 
QuestionPass Guid To Controller Pin
Kevin Marois4-Jun-19 8:37
professionalKevin Marois4-Jun-19 8:37 
using an ASP.Net MVC Web API

I have this controller method:
[HttpDelete]
public Response DeleteRuleDefinition(Guid id)
{
    var response = new Response();

    try
    {
        IRulesBL bl = GetBL();
        bl.DeleteRuleDefinition(id);
    }
    catch (Exception e)
    {
        response.Exception = e;
    }

    return response;
}
I use a RestSharp wrapper class to call it like this:
public async Task<Response> DeleteRuleDefinitionAsync(Guid id)
{
    var webAPIExecutor = new WebAPIExecutor(Credentials, ServerUrl, "/Rules/DeleteRuleDefinition/", Method.GET);
    webAPIExecutor.AddParameter(id, "id");
    return await webAPIExecutor.ExecuteAsync<Response>();
}
This fails with a "No action found..." error.

If I mark the method's param with [FromBody], the method is reached but the Guid is all zeros.

If I make the Guid param a string, and convert to Guid in the controller, the it works fine:
[HttpDelete]
public Response DeleteRuleDefinition(string id)
{
    var response = new Response();

    try
    {
        IRulesBL bl = GetBL();
        bl.DeleteRuleDefinition(new Guid(id));        // CONVERT STRING TO GUID HERE
    }
    catch (Exception e)
    {
        response.Exception = e;
    }

    return response;
}
public async Task<Response> DeleteRuleDefinitionAsync(Guid id)
{
    var webAPIExecutor = new WebAPIExecutor(Credentials, ServerUrl, "/Rules/DeleteRuleDefinition/", Method.GET);
    webAPIExecutor.AddParameter(id.ToString(), "id");  // < ==========
    return await webAPIExecutor.ExecuteAsync<Response<List<RuleDefintionEntity>>>();
}

What's the right way to pass a Guid to a controller?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.


modified 4-Jun-19 14:48pm.

AnswerRe: Pass Guid To Controller Pin
Richard Deeming5-Jun-19 12:26
mveRichard Deeming5-Jun-19 12:26 
GeneralRe: Pass Guid To Controller Pin
Kevin Marois7-Jun-19 8:03
professionalKevin Marois7-Jun-19 8:03 
GeneralRe: Pass Guid To Controller Pin
Kevin Marois11-Jun-19 12:08
professionalKevin Marois11-Jun-19 12:08 
QuestionConfused about App secrets Pin
Super Lloyd30-May-19 19:32
memberSuper Lloyd30-May-19 19:32 
AnswerRe: Confused about App secrets Pin
Kornfeld Eliyahu Peter2-Jun-19 22:44
mveKornfeld Eliyahu Peter2-Jun-19 22:44 
AnswerRe: Confused about App secrets Pin
Eddy Vluggen2-Jun-19 23:04
mveEddy Vluggen2-Jun-19 23:04 
QuestionPowershell script not working suddenly Pin
Member 1447460730-May-19 12:15
memberMember 1447460730-May-19 12:15 
AnswerRe: Powershell script not working suddenly Pin
Richard Deeming31-May-19 0:48
mveRichard Deeming31-May-19 0:48 
GeneralRe: Powershell script not working suddenly Pin
Member 1447460731-May-19 5:22
memberMember 1447460731-May-19 5:22 
GeneralRe: Powershell script not working suddenly Pin
Richard Deeming31-May-19 6:05
mveRichard Deeming31-May-19 6:05 
QuestionASP.Net Web API Deployment Not Working Pin
Kevin Marois29-May-19 6:56
professionalKevin Marois29-May-19 6:56 
AnswerRe: ASP.Net Web API Deployment Not Working Pin
Richard Deeming29-May-19 7:21
mveRichard Deeming29-May-19 7:21 
GeneralRe: ASP.Net Web API Deployment Not Working Pin
Kevin Marois29-May-19 7:42
professionalKevin Marois29-May-19 7:42 
GeneralRe: ASP.Net Web API Deployment Not Working Pin
Richard Deeming29-May-19 7:53
mveRichard Deeming29-May-19 7:53 
GeneralRe: ASP.Net Web API Deployment Not Working Pin
Kevin Marois29-May-19 8:12
professionalKevin Marois29-May-19 8:12 
QuestionPhoto Collage in Bootstrap...possible? Pin
Member 1208020129-May-19 6:05
memberMember 1208020129-May-19 6:05 
AnswerRe: Photo Collage in Bootstrap...possible? Pin
Pete O'Hanlon29-May-19 22:04
protectorPete O'Hanlon29-May-19 22:04 

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.