Does new {} create a new object that needs to be garbage collected? [Answered] catch(Exception ex)
{
return StatusCode(500, new { Message= ex.Message} );
}
In this code, does new create a new object or is it optimized in some way to not be garbage collected?