mercredi 16 décembre 2015

C# Visual Studio debugger

While debugging the next piece of code (step over with F10), I see "test" being set to "false" but the debugger highlights the first throw, without really throwing.. Why is this?!

[Route("CreateUserManager")]
    [AllowAnonymous]
    [HttpPost]
    public void CreateUserManager([FromBody]CreateUserModel model, [FromUri] int CrmId)
    {
        if (ModelState.IsValid)
        {
            bool test = false;
            if (test)
                throw new HttpResponseException(HttpStatusCode.Conflict);

            try
            {
            }
            catch (Exception e)
            {
            }

        }
        throw new HttpResponseException(HttpStatusCode.BadRequest);
    }

Aucun commentaire:

Enregistrer un commentaire