1

I am trying to include the following in my C# code snippet into my controller:

return NotFound($"Could not find item with id of {command.ID}");

When I try to add it to the code snippet and execute the snippet, everything after the ( is not there.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
Mike Lenart
  • 767
  • 1
  • 5
  • 19
  • @Aybe Yes it did. I did the following: dollar Replace the dollar sign character $ Usage (line breaks are added for clarity on Stack Overflow, not in the original.): string errMessage = $dollar$"Error occurred in {MethodBase.GetCurrentMethod().Module}, in procedure {MethodBase.GetCurrentMethod().Name}: {ex.Message}".ToString(); – Mike Lenart Jul 10 '20 at 01:28

1 Answers1

1

Here is the solution:

<Literal Editable="true">
    <ID>dollar</ID>
    <ToolTip>Replace the dollar sign character</ToolTip>
    <Default>$</Default>
    <Function></Function>
</Literal>

Usage (line breaks are added for clarity on Stack Overflow, not in the original.):

string errMessage = $dollar$"Error occurred in
   {MethodBase.GetCurrentMethod().Module}, in procedure
   {MethodBase.GetCurrentMethod().Name}: {ex.Message}".ToString();
Mike Lenart
  • 767
  • 1
  • 5
  • 19